Class: AbideDevUtils::Ppt::Hiera::HierarchyEntry
- Inherits:
-
Object
- Object
- AbideDevUtils::Ppt::Hiera::HierarchyEntry
- Defined in:
- lib/abide_dev_utils/ppt/hiera.rb
Overview
Represents a single entry in the hierarchy
Instance Attribute Summary collapse
-
#entry ⇒ Object
readonly
Returns the value of attribute entry.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#paths ⇒ Object
readonly
Returns the value of attribute paths.
Instance Method Summary collapse
-
#initialize(entry) ⇒ HierarchyEntry
constructor
A new instance of HierarchyEntry.
- #local_files ⇒ Object
- #local_files_with_fact(fact_str, value = nil) ⇒ Object
- #local_files_with_facts(*fact_arrays) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(entry) ⇒ HierarchyEntry
Returns a new instance of HierarchyEntry.
131 132 133 134 135 |
# File 'lib/abide_dev_utils/ppt/hiera.rb', line 131 def initialize(entry) @entry = entry @name = @entry['name'] @paths = @entry.key?('path') ? create_paths(@entry['path']) : create_paths(*@entry['paths']) end |
Instance Attribute Details
#entry ⇒ Object (readonly)
Returns the value of attribute entry.
129 130 131 |
# File 'lib/abide_dev_utils/ppt/hiera.rb', line 129 def entry @entry end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
129 130 131 |
# File 'lib/abide_dev_utils/ppt/hiera.rb', line 129 def name @name end |
#paths ⇒ Object (readonly)
Returns the value of attribute paths.
129 130 131 |
# File 'lib/abide_dev_utils/ppt/hiera.rb', line 129 def paths @paths end |
Instance Method Details
#local_files ⇒ Object
137 138 139 |
# File 'lib/abide_dev_utils/ppt/hiera.rb', line 137 def local_files @local_files ||= paths.map(&:local_files).flatten end |
#local_files_with_fact(fact_str, value = nil) ⇒ Object
141 142 143 |
# File 'lib/abide_dev_utils/ppt/hiera.rb', line 141 def local_files_with_fact(fact_str, value = nil) paths.map { |p| p.local_files_with_fact(fact_str, value) }.flatten end |
#local_files_with_facts(*fact_arrays) ⇒ Object
145 146 147 |
# File 'lib/abide_dev_utils/ppt/hiera.rb', line 145 def local_files_with_facts(*fact_arrays) paths.map { |p| p.local_files_with_facts(*fact_arrays) }.flatten end |
#to_s ⇒ Object
149 150 151 |
# File 'lib/abide_dev_utils/ppt/hiera.rb', line 149 def to_s name end |