Class: PuppetLanguageServer::Sidecar::Protocol::PuppetClass
- Inherits:
-
BasePuppetObject
- Object
- BaseClass
- BasePuppetObject
- PuppetLanguageServer::Sidecar::Protocol::PuppetClass
- Defined in:
- lib/puppet-languageserver/sidecar_protocol.rb
Instance Attribute Summary collapse
-
#doc ⇒ Object
Returns the value of attribute doc.
-
#parameters ⇒ Object
Returns the value of attribute parameters.
Attributes inherited from BasePuppetObject
#calling_source, #char, #key, #length, #line, #source
Instance Method Summary collapse
Methods inherited from BaseClass
#==, #eql?, #from_json!, #hash, #to_json
Methods included from Base
Instance Attribute Details
#doc ⇒ Object
Returns the value of attribute doc.
161 162 163 |
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 161 def doc @doc end |
#parameters ⇒ Object
Returns the value of attribute parameters.
161 162 163 |
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 161 def parameters @parameters end |
Instance Method Details
#from_h!(value) ⇒ Object
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 170 def from_h!(value) super self.doc = value['doc'] self.parameters = {} unless value['parameters'].nil? value['parameters'].each do |attr_name, obj_attr| # TODO: This should be a class, not a hash parameters[attr_name] = { type: value_from_hash(obj_attr, :type), doc: value_from_hash(obj_attr, :doc) } end end self end |
#to_h ⇒ Object
163 164 165 166 167 168 |
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 163 def to_h super.to_h.merge( 'doc' => doc, 'parameters' => parameters ) end |