Class: PuppetLanguageServer::Sidecar::Protocol::PuppetFunction
- Inherits:
-
BasePuppetObject
- Object
- BaseClass
- BasePuppetObject
- PuppetLanguageServer::Sidecar::Protocol::PuppetFunction
- Defined in:
- lib/puppet-languageserver/sidecar_protocol.rb
Instance Attribute Summary collapse
-
#doc ⇒ Object
Returns the value of attribute doc.
-
#function_version ⇒ Object
The version of this function, typically 3 or 4.
-
#signatures ⇒ Object
Returns the value of attribute signatures.
Attributes inherited from BasePuppetObject
#calling_source, #char, #key, #length, #line, #source
Instance Method Summary collapse
- #from_h!(value) ⇒ Object
-
#initialize ⇒ PuppetFunction
constructor
A new instance of PuppetFunction.
- #to_h ⇒ Object
Methods inherited from BaseClass
#==, #eql?, #from_json!, #hash, #to_json
Methods included from Base
Constructor Details
#initialize ⇒ PuppetFunction
Returns a new instance of PuppetFunction.
260 261 262 263 |
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 260 def initialize super self.signatures = PuppetFunctionSignatureList.new end |
Instance Attribute Details
#doc ⇒ Object
Returns the value of attribute doc.
256 257 258 |
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 256 def doc @doc end |
#function_version ⇒ Object
The version of this function, typically 3 or 4.
258 259 260 |
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 258 def function_version @function_version end |
#signatures ⇒ Object
Returns the value of attribute signatures.
256 257 258 |
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 256 def signatures @signatures end |
Instance Method Details
#from_h!(value) ⇒ Object
273 274 275 276 277 278 279 280 |
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 273 def from_h!(value) super self.doc = value['doc'] self.function_version = value['function_version'] value['signatures'].each { |sig| signatures << PuppetFunctionSignature.new.from_h!(sig) } unless value['signatures'].nil? self end |
#to_h ⇒ Object
265 266 267 268 269 270 271 |
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 265 def to_h super.to_h.merge( 'doc' => doc, 'function_version' => function_version, 'signatures' => signatures.map(&:to_h) ) end |