Class: PuppetLanguageServer::Sidecar::Protocol::PuppetDataType
- Inherits:
-
BasePuppetObject
- Object
- BaseClass
- BasePuppetObject
- PuppetLanguageServer::Sidecar::Protocol::PuppetDataType
- Defined in:
- lib/puppet-languageserver/sidecar_protocol.rb
Instance Attribute Summary collapse
-
#alias_of ⇒ Object
Returns the value of attribute alias_of.
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#doc ⇒ Object
Returns the value of attribute doc.
-
#is_type_alias ⇒ Object
Returns the value of attribute is_type_alias.
Attributes inherited from BasePuppetObject
#calling_source, #char, #key, #length, #line, #source
Instance Method Summary collapse
- #from_h!(value) ⇒ Object
-
#initialize ⇒ PuppetDataType
constructor
A new instance of PuppetDataType.
- #to_h ⇒ Object
Methods inherited from BaseClass
#==, #eql?, #from_json!, #hash, #to_json
Methods included from Base
Constructor Details
#initialize ⇒ PuppetDataType
Returns a new instance of PuppetDataType.
197 198 199 200 |
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 197 def initialize super self.attributes = PuppetDataTypeAttributeList.new end |
Instance Attribute Details
#alias_of ⇒ Object
Returns the value of attribute alias_of.
195 196 197 |
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 195 def alias_of @alias_of end |
#attributes ⇒ Object
Returns the value of attribute attributes.
195 196 197 |
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 195 def attributes @attributes end |
#doc ⇒ Object
Returns the value of attribute doc.
195 196 197 |
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 195 def doc @doc end |
#is_type_alias ⇒ Object
Returns the value of attribute is_type_alias.
195 196 197 |
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 195 def is_type_alias @is_type_alias end |
Instance Method Details
#from_h!(value) ⇒ Object
211 212 213 214 215 216 217 218 219 |
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 211 def from_h!(value) super self.doc = value['doc'] self.alias_of = value['alias_of'] value['attributes'].each { |attr| attributes << PuppetDataTypeAttribute.new.from_h!(attr) } unless value['attributes'].nil? self.is_type_alias = value['is_type_alias'] self end |
#to_h ⇒ Object
202 203 204 205 206 207 208 209 |
# File 'lib/puppet-languageserver/sidecar_protocol.rb', line 202 def to_h super.to_h.merge( 'doc' => doc, 'alias_of' => alias_of, 'attributes' => attributes.map(&:to_h), 'is_type_alias' => is_type_alias ) end |