Class: PuppetLanguageServer::Sidecar::Protocol::PuppetFunctionSignature

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?, #from_json!, #hash, #to_json

Methods included from Base

#from_json!, #to_json

Constructor Details

#initializePuppetFunctionSignature

Returns a new instance of PuppetFunctionSignature.



292
293
294
295
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 292

def initialize
  super
  self.parameters = PuppetFunctionSignatureParameterList.new
end

Instance Attribute Details

#docObject

Returns the value of attribute doc.



290
291
292
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 290

def doc
  @doc
end

#keyObject

Returns the value of attribute key.



290
291
292
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 290

def key
  @key
end

#parametersObject

Returns the value of attribute parameters.



290
291
292
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 290

def parameters
  @parameters
end

#return_typesObject

Returns the value of attribute return_types.



290
291
292
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 290

def return_types
  @return_types
end

Instance Method Details

#from_h!(value) ⇒ Object



306
307
308
309
310
311
312
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 306

def from_h!(value)
  self.key = value['key']
  self.doc = value['doc']
  self.return_types = value['return_types']
  value['parameters'].each { |param| parameters << PuppetFunctionSignatureParameter.new.from_h!(param) } unless value['parameters'].nil?
  self
end

#to_hObject



297
298
299
300
301
302
303
304
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 297

def to_h
  {
    'key' => key,
    'doc' => doc,
    'return_types' => return_types,
    'parameters' => parameters.map(&:to_h)
  }
end