Class: Streamer::Functors::Lookup
- Defined in:
- lib/streamer/functors/lookup.rb
Overview
Lookup looks up a fact given a finder
Instance Attribute Summary
Attributes inherited from Functor
Instance Method Summary collapse
Methods inherited from Functor
#class_name, #initialize, #type_name
Constructor Details
This class inherits a constructor from Streamer::Functors::Functor
Instance Method Details
#call ⇒ Object
5 6 7 8 |
# File 'lib/streamer/functors/lookup.rb', line 5 def call finder = .fetch(:finder) finder.find(lookup_key) end |
#lookup_key ⇒ Object
10 11 12 13 |
# File 'lib/streamer/functors/lookup.rb', line 10 def lookup_key item_key = .fetch(:terms)[0] [:fact] = .fetch(:fact).gsub('#', "#{item_key}.") end |