Class: Puppet::Pops::Lookup::ResolvedLocation Private

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet/pops/lookup/location_resolver.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Class that keeps track of the original location (as it appears in the declaration, before interpolation), and the fully resolved location, and whether or not the resolved location exists.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(original_location, location, exist) ⇒ ResolvedLocation

Returns a new instance of ResolvedLocation.

Parameters:

  • original_location (String)

    location as found in declaration. May contain interpolation expressions

  • location (Pathname, URI)

    the expanded location

  • exist (Boolean)

    ‘true` if the location is assumed to exist



17
18
19
20
21
# File 'lib/puppet/pops/lookup/location_resolver.rb', line 17

def initialize(original_location, location, exist)
  @original_location = original_location
  @location = location
  @exist = exist
end

Instance Attribute Details

#locationObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



11
12
13
# File 'lib/puppet/pops/lookup/location_resolver.rb', line 11

def location
  @location
end

#original_locationObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



11
12
13
# File 'lib/puppet/pops/lookup/location_resolver.rb', line 11

def original_location
  @original_location
end

Instance Method Details

#exist?Boolean

Returns ‘true` if the location is assumed to exist.

Returns:

  • (Boolean)

    ‘true` if the location is assumed to exist



25
26
27
# File 'lib/puppet/pops/lookup/location_resolver.rb', line 25

def exist?
  @exist
end

#to_sObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the resolved location as a string.

Returns:

  • the resolved location as a string



30
31
32
# File 'lib/puppet/pops/lookup/location_resolver.rb', line 30

def to_s
  @location.to_s
end