Class: Droonga::Plugins::Basic::ReduceCollector

Inherits:
Collector
  • Object
show all
Defined in:
lib/droonga/plugins/basic.rb

Instance Method Summary collapse

Methods inherited from Collector

#initialize, message

Methods included from Droonga::Pluggable

#find_sub_classes, #options

Constructor Details

This class inherits a constructor from Droonga::Collector

Instance Method Details

#collect(message) ⇒ Object



42
43
44
45
46
47
48
49
50
# File 'lib/droonga/plugins/basic.rb', line 42

def collect(message)
  message.input.each do |output_name, deal|
    left_value = message.values[output_name]
    right_value = message.value
    reducer = Reducer.new(deal)
    value = reducer.reduce(left_value, right_value)
    message.values[output_name] = value
  end
end