Class: Puppet::Plugins::DataProviders::ResolvedPath
- Defined in:
- lib/puppet/plugins/data_providers/data_provider.rb
Overview
Class that keeps track of the original path (as it appears in the declaration, before interpolation), the fully resolved path, and whether or the resolved path exists.
Instance Attribute Summary collapse
- #original_path ⇒ Object readonly
- #path ⇒ Object readonly
Instance Method Summary collapse
-
#exists? ⇒ Boolean
Cached info if the path exists or not.
-
#initialize(original_path, path) ⇒ ResolvedPath
constructor
A new instance of ResolvedPath.
Constructor Details
#initialize(original_path, path) ⇒ ResolvedPath
Returns a new instance of ResolvedPath.
151 152 153 154 155 |
# File 'lib/puppet/plugins/data_providers/data_provider.rb', line 151 def initialize(original_path, path) @original_path = original_path @path = path @exists = nil end |
Instance Attribute Details
#original_path ⇒ Object (readonly)
146 147 148 |
# File 'lib/puppet/plugins/data_providers/data_provider.rb', line 146 def original_path @original_path end |
#path ⇒ Object (readonly)
146 147 148 |
# File 'lib/puppet/plugins/data_providers/data_provider.rb', line 146 def path @path end |
Instance Method Details
#exists? ⇒ Boolean
Returns cached info if the path exists or not.
159 160 161 162 |
# File 'lib/puppet/plugins/data_providers/data_provider.rb', line 159 def exists? @exists = @path.exist? if @exists.nil? @exists end |