Class: PuppetLanguageServer::Sidecar::Protocol::PuppetFunctionSignature
- Inherits:
-
BaseClass
- Object
- BaseClass
- PuppetLanguageServer::Sidecar::Protocol::PuppetFunctionSignature
- Defined in:
- lib/puppet-languageserver/sidecar_protocol.rb
Instance Attribute Summary collapse
-
#doc ⇒ Object
Returns the value of attribute doc.
-
#key ⇒ Object
Returns the value of attribute key.
-
#parameters ⇒ Object
Returns the value of attribute parameters.
-
#return_types ⇒ Object
Returns the value of attribute return_types.
Instance Method Summary collapse
- #from_h!(value) ⇒ Object
-
#initialize ⇒ PuppetFunctionSignature
constructor
A new instance of PuppetFunctionSignature.
- #to_h ⇒ Object
Methods inherited from BaseClass
#==, #eql?, #from_json!, #hash, #to_json
Methods included from Base
Constructor Details
#initialize ⇒ PuppetFunctionSignature
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
#doc ⇒ Object
Returns the value of attribute doc.
290 291 292 |
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 290 def doc @doc end |
#key ⇒ Object
Returns the value of attribute key.
290 291 292 |
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 290 def key @key end |
#parameters ⇒ Object
Returns the value of attribute parameters.
290 291 292 |
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 290 def parameters @parameters end |
#return_types ⇒ Object
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_h ⇒ Object
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 |