Class: DTK::DSL::ServiceAndComponentInfo::TransformFrom::Parser::TopDSL::Assemblies

Inherits:
DTK::DSL::ServiceAndComponentInfo::TransformFrom::Parser::TopDSL show all
Defined in:
lib/dsl/service_and_component_info/transform_from/parser/top_dsl/assemblies.rb,
lib/dsl/service_and_component_info/transform_from/parser/top_dsl/assemblies/workflows.rb,
lib/dsl/service_and_component_info/transform_from/parser/top_dsl/assemblies/node_bindings.rb

Defined Under Namespace

Modules: NodeBindings, Workflows

Instance Attribute Summary

Attributes inherited from Parser

#info_object, #output_hash

Instance Method Summary collapse

Methods inherited from Parser

update_output_hash?

Instance Method Details

#update_output_hash?Boolean

Returns:

  • (Boolean)


24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/dsl/service_and_component_info/transform_from/parser/top_dsl/assemblies.rb', line 24

def update_output_hash?
  input_files(:assemblies).content_hash_array.each do |input_hash|
    name          = input_hash['name'] || raise_error_missing_field('name')
    assembly_hash = input_hash['assembly'] || raise_error_missing_field('assembly')

    assembly_content = {}
    if description  = input_hash['description']
      assembly_content.merge!('description' => description)
    end
    
    assembly_content.merge!(assembly_hash)
    
    if workflows = Workflows.hash_content?(input_hash)
      assembly_content.merge!('actions' => workflows) 
    end

    if node_bindings = input_hash['node_bindings']
      # convert node_bindings to node attributes
      NodeBindings.add_node_properties!(assembly_content, node_bindings) 
    end
    (output_hash['assemblies'] ||= {}).merge!(name => assembly_content)
  end

end