summaryrefslogtreecommitdiff
path: root/lib/rexml/functions.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rexml/functions.rb')
-rw-r--r--lib/rexml/functions.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/rexml/functions.rb b/lib/rexml/functions.rb
index 7a2fb996a0..0db9b98a53 100644
--- a/lib/rexml/functions.rb
+++ b/lib/rexml/functions.rb
@@ -339,6 +339,8 @@ module REXML
end
def Functions::sum( nodes )
+ nodes = [nodes] unless nodes.kind_of? Array
+ nodes.inject(0) { |r,n| r += number(string(n)) }
end
def Functions::floor( number )