Class: Ldpath::Selector
- Inherits:
-
Object
- Object
- Ldpath::Selector
- Defined in:
- lib/ldpath/selectors.rb
Direct Known Subclasses
CompoundSelector, FunctionSelector, LoosePropertySelector, NegatedPropertySelector, PropertySelector, RecursivePathSelector, ReversePropertySelector, SelfSelector, TapSelector, TestSelector, WildcardSelector
Instance Method Summary collapse
- #evaluate(program, uris, context) ⇒ Object
-
#initialize(*_args) ⇒ Selector
constructor
A new instance of Selector.
- #loading(program, uri, context) ⇒ Object
Constructor Details
#initialize(*_args) ⇒ Selector
Returns a new instance of Selector.
20 21 22 |
# File 'lib/ldpath/selectors.rb', line 20 def initialize(*_args) # abstract base class end |
Instance Method Details
#evaluate(program, uris, context) ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/ldpath/selectors.rb', line 5 def evaluate(program, uris, context) return to_enum(:evaluate, program, uris, context) unless block_given? enum_wrap(uris).map do |uri| loading program, uri, context enum_flatten_one(evaluate_one(uri, context)).each do |x| yield x unless x.nil? end end end |
#loading(program, uri, context) ⇒ Object
16 17 18 |
# File 'lib/ldpath/selectors.rb', line 16 def loading(program, uri, context) program.loading uri, context end |