Class: Ldpath::IntersectionSelector

Inherits:
CompoundSelector show all
Defined in:
lib/ldpath/selectors.rb

Instance Attribute Summary

Attributes inherited from CompoundSelector

#left, #right

Instance Method Summary collapse

Methods inherited from CompoundSelector

#initialize

Methods inherited from Selector

#initialize, #loading

Constructor Details

This class inherits a constructor from Ldpath::CompoundSelector

Instance Method Details

#evaluate(program, uris, context, &block) ⇒ Object



219
220
221
222
223
224
225
# File 'lib/ldpath/selectors.rb', line 219

def evaluate(program, uris, context, &block)
  return to_enum(:evaluate, program, uris, context) unless block_given?

  result = left.evaluate(program, uris, context).to_a & right.evaluate(program, uris, context).to_a

  result.each(&block)
end