Class: PuppetLanguageServer::Sidecar::Protocol::PuppetNodeGraph

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseClass

#==, #eql?, #hash

Instance Attribute Details

#edgesObject

Returns the value of attribute edges.



141
142
143
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 141

def edges
  @edges
end

#error_contentObject

Returns the value of attribute error_content.



141
142
143
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 141

def error_content
  @error_content
end

#verticesObject

Returns the value of attribute vertices.



141
142
143
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 141

def vertices
  @vertices
end

Instance Method Details

#from_json!(json_string) ⇒ Object



151
152
153
154
155
156
157
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 151

def from_json!(json_string)
  obj = ::JSON.parse(json_string)
  self.vertices = obj['vertices']
  self.edges = obj['edges']
  self.error_content = obj['error_content']
  self
end

#to_json(*options) ⇒ Object



143
144
145
146
147
148
149
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 143

def to_json(*options)
  {
    'vertices' => vertices,
    'edges' => edges,
    'error_content' => error_content
  }.to_json(options)
end