Class: ArcFurnace::Merge
Instance Attribute Summary
Attributes inherited from Node
#error_handler, #node_id, #params
Instance Method Summary collapse
- #advance ⇒ Object
-
#initialize(sources:) ⇒ Merge
constructor
A new instance of Merge.
- #value ⇒ Object
Methods inherited from Source
#close, #empty?, #finalize, #prepare, #row
Constructor Details
#initialize(sources:) ⇒ Merge
Returns a new instance of Merge.
8 9 10 |
# File 'lib/arc-furnace/merge.rb', line 8 def initialize(sources:) @sources = sources end |
Instance Method Details
#advance ⇒ Object
12 13 14 |
# File 'lib/arc-furnace/merge.rb', line 12 def advance sources.first.advance end |
#value ⇒ Object
16 17 18 19 20 |
# File 'lib/arc-furnace/merge.rb', line 16 def value value = sources.map(&:value).compact return unless value.present? value.map(&:deep_dup).reduce({}, :merge) end |