Class: Remap::Rule::Collection::Filled
- Inherits:
-
Unit
- Object
- Unit
- Remap::Rule::Collection::Filled
- Defined in:
- lib/remap/rule/support/collection/filled.rb
Instance Method Summary collapse
-
#call(state) ⇒ State
Represents a non-empty define block with one or more rules Calls every #rules with input and merges the output.
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
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 |