Class: PuppetLanguageServer::Sidecar::Protocol::BasePuppetObject

Inherits:
BaseClass
  • Object
show all
Defined in:
lib/puppet-languageserver/sidecar_protocol.rb

Overview

key => Unique name of the object calling_source => The file that was invoked to create the object source => The file that actually created the object line => The line number in the source file where the object was created char => The character number in the source file where the object was created length => The length of characters from ‘char` in the source file where the object was created

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseClass

#==, #eql?, #from_json!, #hash, #to_json

Methods included from Base

#from_json!, #to_json

Instance Attribute Details

#calling_sourceObject

Returns the value of attribute calling_source.



88
89
90
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 88

def calling_source
  @calling_source
end

#charObject

Returns the value of attribute char.



88
89
90
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 88

def char
  @char
end

#keyObject

Returns the value of attribute key.



88
89
90
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 88

def key
  @key
end

#lengthObject

Returns the value of attribute length.



88
89
90
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 88

def length
  @length
end

#lineObject

Returns the value of attribute line.



88
89
90
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 88

def line
  @line
end

#sourceObject

Returns the value of attribute source.



88
89
90
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 88

def source
  @source
end

Instance Method Details

#from_h!(value) ⇒ Object



101
102
103
104
105
106
107
108
109
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 101

def from_h!(value)
  self.key            = value['key'].nil? ? nil : value['key'].intern
  self.calling_source = value['calling_source']
  self.source         = value['source']
  self.line           = value['line']
  self.char           = value['char']
  self.length         = value['length']
  self
end

#to_hObject



90
91
92
93
94
95
96
97
98
99
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 90

def to_h
  {
    'key' => key,
    'calling_source' => calling_source,
    'source' => source,
    'line' => line,
    'char' => char,
    'length' => length
  }
end