module DTK::DSL::ServiceAndComponentInfo::TransformFrom::Parser::TopDSL::Assemblies::Workflows

Public Class Methods

hash_content?(assembly_hash) click to toggle source
# File lib/dsl/service_and_component_info/transform_from/parser/top_dsl/assemblies/workflows.rb, line 22
def self.hash_content?(assembly_hash)
  if workflows = assembly_hash['workflow'] || assembly_hash['workflows'] || assembly_hash['actions']
    if workflow_name = workflows['assembly_action']
      # this is legacy workflow
      workflows_without_name = workflows.inject({}) { |h, (k, v)| k == 'assembly_action' ? h : h.merge(k => v) }
      { workflow_name =>  workflows_without_name }
    else
      workflows
    end
  end
end