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.
134 135 136 137 138 |
# File 'lib/abide_dev_utils/ppt/hiera.rb', line 134 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.
132 133 134 |
# File 'lib/abide_dev_utils/ppt/hiera.rb', line 132 def entry @entry end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
132 133 134 |
# File 'lib/abide_dev_utils/ppt/hiera.rb', line 132 def name @name end |
#paths ⇒ Object (readonly)
Returns the value of attribute paths.
132 133 134 |
# File 'lib/abide_dev_utils/ppt/hiera.rb', line 132 def paths @paths end |
Instance Method Details
#local_files ⇒ Object
140 141 142 |
# File 'lib/abide_dev_utils/ppt/hiera.rb', line 140 def local_files @local_files ||= paths.map(&:local_files).flatten end |
#local_files_with_fact(fact_str, value = nil) ⇒ Object
144 145 146 |
# File 'lib/abide_dev_utils/ppt/hiera.rb', line 144 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
148 149 150 |
# File 'lib/abide_dev_utils/ppt/hiera.rb', line 148 def local_files_with_facts(*fact_arrays) paths.map { |p| p.local_files_with_facts(*fact_arrays) }.flatten end |
#to_s ⇒ Object
152 153 154 |
# File 'lib/abide_dev_utils/ppt/hiera.rb', line 152 def to_s name end |