class DTK::DSL::ServiceAndComponentInfo::Info::InputFiles

Public Class Methods

new(regexps) click to toggle source
# File lib/dsl/service_and_component_info/info/input_files.rb, line 21
def initialize(regexps)
  @regexps = regexps

  # dyanmically set
  # For TransformFrom hash_content is type ::Hash where for TransformTo it is type InputOutputCommon::Canonical::Hash
  @ndx_file_hash_content = {} #indexed by file hash name
end

Public Instance Methods

content_hash?() click to toggle source
# File lib/dsl/service_and_component_info/info/input_files.rb, line 45
def content_hash?
  fail Error, "Unexpected that @ndx_file_hash_content.size > 1" if @ndx_file_hash_content.size > 1
  @ndx_file_hash_content.values.first
end
content_hash_array() click to toggle source
# File lib/dsl/service_and_component_info/info/input_files.rb, line 33
def content_hash_array
  @ndx_file_hash_content.values
end
empty?() click to toggle source
# File lib/dsl/service_and_component_info/info/input_files.rb, line 41
def empty?
  @ndx_file_hash_content.empty?
end
input_paths() click to toggle source
# File lib/dsl/service_and_component_info/info/input_files.rb, line 37
def input_paths
  @ndx_file_hash_content.keys
end
match?(path) click to toggle source
# File lib/dsl/service_and_component_info/info/input_files.rb, line 29
def match?(path)
  @regexps.find { |regexp| path =~ regexp }
end

Private Instance Methods

add_hash_content!(path, hash_content) click to toggle source
# File lib/dsl/service_and_component_info/info/input_files.rb, line 52
def add_hash_content!(path, hash_content)
  @ndx_file_hash_content.merge!(path => hash_content)
end