Class: Retl::PathHandler

Inherits:
Handler show all
Defined in:
lib/retl/handlers/path_handler.rb

Instance Method Summary collapse

Methods inherited from Handler

#output

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