Class: Retl::PathHandler
- Defined in:
- lib/retl/handlers/path_handler.rb
Instance Method Summary collapse
-
#initialize(path, dependencies = {}, &block) ⇒ PathHandler
constructor
A new instance of PathHandler.
- #push_in(data, context) ⇒ Object
Methods inherited from Handler
Constructor Details
#initialize(path, dependencies = {}, &block) ⇒ PathHandler
Returns a new instance of PathHandler.
5 6 7 8 9 10 |
# File 'lib/retl/handlers/path_handler.rb', line 5 def initialize(path, dependencies={}, &block) super() @path = path dependencies.merge!(block.call) if block @context = Context.new(@path, dependencies) end |
Instance Method Details
#push_in(data, context) ⇒ Object
12 13 14 15 16 |
# File 'lib/retl/handlers/path_handler.rb', line 12 def push_in(data, context) @context.execute_step(@path, data).each do |result| push_out(result) end end |