Class: Mantra::Transform::Merge

Inherits:
Mantra::Transform show all
Defined in:
lib/mantra/transform/merge.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Mantra::Transform

description, #ensure_yml_file_exist, input, inputs, #merge_tool, #previous_transform, #raise_error_if_no_source_manifest, #run, #source_manifest, #target_manifest, #validate_inputs

Methods included from Helpers::ObjectWithType

included

Instance Attribute Details

#manifestObject

Returns the value of attribute manifest.



5
6
7
# File 'lib/mantra/transform/merge.rb', line 5

def manifest
  @manifest
end

Instance Method Details

#performObject



14
15
16
17
18
19
20
21
22
# File 'lib/mantra/transform/merge.rb', line 14

def perform
  @manifest = previous_transform.manifest
  value_manifest_element = Mantra::Manifest::Element.create(self.value).content

  scope = @manifest.fetch(self.scope)
  scope.each do |s|
    s.merge(value_manifest_element)
  end
end