method
inject
inject( xpath=nil, initial=nil, &block )
public
Hide source
# File lib/rexml/element.rb, line 902 def inject( xpath=nil, initial=nil, &block ) first = true XPath::each( @element, xpath ) {|e| if (e.kind_of? Element) if (first and initial == nil) initial = e first = false else initial = yield( initial, e ) if e.kind_of? Element end end } initial end