Class: Puppet::Pops::Adapters::SourcePosAdapter Deprecated Private

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet/pops/adapters.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.

Deprecated.

This class is for backward compatibility only. It’s not really an adapter but it is needed for the puppetlabs-strings gem

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object) ⇒ SourcePosAdapter

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 a new instance of SourcePosAdapter.



47
48
49
# File 'lib/puppet/pops/adapters.rb', line 47

def initialize(object)
  @object = object
end

Class Method Details

.adapt(object) ⇒ Object

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.



43
44
45
# File 'lib/puppet/pops/adapters.rb', line 43

def self.adapt(object)
  new(object)
end

Instance Method Details

#extract_textObject

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.



63
64
65
# File 'lib/puppet/pops/adapters.rb', line 63

def extract_text
  @object.locator.extract_text(@object.offset, @object.length)
end

#fileObject

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.



51
52
53
# File 'lib/puppet/pops/adapters.rb', line 51

def file
  @object.file
end

#lineObject

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.



55
56
57
# File 'lib/puppet/pops/adapters.rb', line 55

def line
  @object.line
end

#posObject

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.



59
60
61
# File 'lib/puppet/pops/adapters.rb', line 59

def pos
  @object.pos
end