Class: AbideDevUtils::Ppt::Hiera::EntryPathLocalFile
- Inherits:
-
Object
- Object
- AbideDevUtils::Ppt::Hiera::EntryPathLocalFile
- Defined in:
- lib/abide_dev_utils/ppt/hiera.rb
Overview
Represents a local file derived from a Hiera path
Instance Attribute Summary collapse
-
#facts ⇒ Object
readonly
Returns the value of attribute facts.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #exist? ⇒ Boolean
- #fact_values ⇒ Object
-
#initialize(path, facts, possible_fact_values) ⇒ EntryPathLocalFile
constructor
A new instance of EntryPathLocalFile.
- #path_parts ⇒ Object
- #to_h ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(path, facts, possible_fact_values) ⇒ EntryPathLocalFile
Returns a new instance of EntryPathLocalFile.
254 255 256 257 258 |
# File 'lib/abide_dev_utils/ppt/hiera.rb', line 254 def initialize(path, facts, possible_fact_values) @path = File.(File.join(AbideDevUtils::Ppt::Hiera.default_datadir, path)) @facts = facts @possible_fact_values = possible_fact_values end |
Instance Attribute Details
#facts ⇒ Object (readonly)
Returns the value of attribute facts.
252 253 254 |
# File 'lib/abide_dev_utils/ppt/hiera.rb', line 252 def facts @facts end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
252 253 254 |
# File 'lib/abide_dev_utils/ppt/hiera.rb', line 252 def path @path end |
Instance Method Details
#exist? ⇒ Boolean
268 269 270 |
# File 'lib/abide_dev_utils/ppt/hiera.rb', line 268 def exist? File.file?(path) end |
#fact_values ⇒ Object
260 261 262 |
# File 'lib/abide_dev_utils/ppt/hiera.rb', line 260 def fact_values @fact_values ||= fact_values_for_path end |
#path_parts ⇒ Object
264 265 266 |
# File 'lib/abide_dev_utils/ppt/hiera.rb', line 264 def path_parts @path_parts ||= path.split('/') end |
#to_h ⇒ Object
276 277 278 279 280 281 |
# File 'lib/abide_dev_utils/ppt/hiera.rb', line 276 def to_h { path: path, facts: facts } end |
#to_s ⇒ Object
272 273 274 |
# File 'lib/abide_dev_utils/ppt/hiera.rb', line 272 def to_s path end |