method
function
function( elements, fname, rest )
public
Hide source
# File lib/rexml/quickpath.rb, line 222 def QuickPath::function( elements, fname, rest ) args = parse_args( elements, rest ) Functions.pair = [0, elements.size] results = [] elements.each do |element| Functions.pair[0] += 1 Functions.node = element res = Functions.send( fname, *args ) case res when true results << element when Integer results << element if Functions.pair[0] == res end end return results end