Class: DTK::DSL::ServiceAndComponentInfo::Info::InputFiles

Inherits:
Object
  • Object
show all
Defined in:
lib/dsl/service_and_component_info/info/input_files.rb

Instance Method Summary collapse

Constructor Details

#initialize(regexps) ⇒ InputFiles

Returns a new instance of InputFiles.



21
22
23
24
25
26
27
# 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

Instance Method Details

#content_hash?Boolean

Returns:

  • (Boolean)


45
46
47
48
# 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_arrayObject



33
34
35
# File 'lib/dsl/service_and_component_info/info/input_files.rb', line 33

def content_hash_array
  @ndx_file_hash_content.values
end

#empty?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/dsl/service_and_component_info/info/input_files.rb', line 41

def empty?
  @ndx_file_hash_content.empty?
end

#input_pathsObject



37
38
39
# File 'lib/dsl/service_and_component_info/info/input_files.rb', line 37

def input_paths
  @ndx_file_hash_content.keys
end

#match?(path) ⇒ Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/dsl/service_and_component_info/info/input_files.rb', line 29

def match?(path)
  @regexps.find { |regexp| path =~ regexp }
end