Class: Remap::Rule::Collection::Filled

Inherits:
Unit
  • Object
show all
Defined in:
lib/remap/rule/support/collection/filled.rb

Instance Method Summary collapse

Instance Method Details

#call(state) ⇒ State

Represents a non-empty define block with one or more rules Calls every #rules with input and merges the output

Parameters:

Returns:



17
18
19
20
21
22
23
# File 'lib/remap/rule/support/collection/filled.rb', line 17

def call(state)
  rules.map do |rule|
    Thread.new(rule, state) { _1.call(_2) }
  end.map(&:value).reduce do |acc, inner_state|
    acc.merged(inner_state)
  end
end