Class: Retl::ForkDataCollector

Inherits:
Object
  • Object
show all
Defined in:
lib/retl/fork_data_collector.rb

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ ForkDataCollector

Returns a new instance of ForkDataCollector.



3
4
5
6
7
8
9
10
11
# File 'lib/retl/fork_data_collector.rb', line 3

def initialize(context)
  @fork_data = {}

  context._events.listen_to(:fork_data) do |args|
    fork_name = args[:fork_name]
    @fork_data[fork_name] ||= []
    @fork_data[fork_name] << args[:data]
  end
end

Instance Method Details

#take(name) ⇒ Object



13
14
15
# File 'lib/retl/fork_data_collector.rb', line 13

def take(name)
  @fork_data.delete(name)
end