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



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

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.



13
14
15
# File 'lib/puppet/pops/lookup/location_resolver.rb', line 13

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.



13
14
15
# File 'lib/puppet/pops/lookup/location_resolver.rb', line 13

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



27
28
29
# File 'lib/puppet/pops/lookup/location_resolver.rb', line 27

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



32
33
34
# File 'lib/puppet/pops/lookup/location_resolver.rb', line 32

def to_s
  @location.to_s
end