diff options
Diffstat (limited to 'lib/rexml')
-rw-r--r-- | lib/rexml/element.rb | 6 | ||||
-rw-r--r-- | lib/rexml/light/node.rb | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/rexml/element.rb b/lib/rexml/element.rb index 5991859a78..83e5f6e623 100644 --- a/lib/rexml/element.rb +++ b/lib/rexml/element.rb @@ -901,11 +901,11 @@ module REXML # #-> Yields <b/>, <c/>, <d/>, <b/>, <c/>, <d/> # XPath.each(doc.root, 'child::node()', &block) # #-> Yields <b/>, <c/>, <d/>, sean, <b/>, <c/>, <d/> - def each( xpath=nil, &block) + def each( xpath=nil ) XPath::each( @element, xpath ) {|e| yield e if e.kind_of? Element } end - def collect( xpath=nil, &block ) + def collect( xpath=nil ) collection = [] XPath::each( @element, xpath ) {|e| collection << yield(e) if e.kind_of?(Element) @@ -913,7 +913,7 @@ module REXML collection end - def inject( xpath=nil, initial=nil, &block ) + def inject( xpath=nil, initial=nil ) first = true XPath::each( @element, xpath ) {|e| if (e.kind_of? Element) diff --git a/lib/rexml/light/node.rb b/lib/rexml/light/node.rb index 0a896c83dc..b33f78f7ce 100644 --- a/lib/rexml/light/node.rb +++ b/lib/rexml/light/node.rb @@ -40,7 +40,7 @@ module REXML end end - def each( &block ) + def each size.times { |x| yield( at(x+4) ) } end |