Class: Ldpath::Selector

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

Instance Method Summary collapse

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