class DTK::DSL::ServiceAndComponentInfo

Attributes

module_ref[R]
output_path_hash_pairs[R]

Public Class Methods

new(namespace, module_name, version = nil) click to toggle source
# File lib/dsl/service_and_component_info.rb, line 29
def initialize(namespace, module_name, version = nil)
  @module_ref = ModuleRef.new(namespace, module_name, version)

  # dynamically computed
  @output_path_hash_pairs = {} 
end

Public Instance Methods

info_processor(info_type) click to toggle source
# File lib/dsl/service_and_component_info.rb, line 36
def info_processor(info_type)
  case info_type 
  when :service_info then self.class::Info::Service.new(self)
  when :component_info then self.class::Info::Component.new(self)
  else
    fail Error, "Unexpected info_type '#{info_type}'"
  end
end
output_path_text_pairs() click to toggle source
# File lib/dsl/service_and_component_info.rb, line 45
def output_path_text_pairs
  @output_path_hash_pairs.inject({}) { |h, (path, hash_content)| h.merge(path => YamlHelper.generate(hash_content)) }
end
update_or_add_output_hash!(path, hash_content) click to toggle source
# File lib/dsl/service_and_component_info.rb, line 50
def update_or_add_output_hash!(path, hash_content)
  @output_path_hash_pairs.merge!(path => hash_content)
end