Class: Ssource::Source::Variable
- Defined in:
- lib/ssource/source/variable.rb
Instance Attribute Summary collapse
-
#typename ⇒ Object
readonly
Returns the value of attribute typename.
Attributes inherited from Element
#accessibility, #body_length, #body_offset, #elements, #kind, #length, #name, #name_length, #name_offset, #offset
Instance Method Summary collapse
-
#initialize(json) ⇒ Variable
constructor
A new instance of Variable.
- #pretty_print ⇒ Object
- #to_hash ⇒ Object
Methods inherited from Element
Constructor Details
#initialize(json) ⇒ Variable
Returns a new instance of Variable.
5 6 7 8 |
# File 'lib/ssource/source/variable.rb', line 5 def initialize(json) super @typename = json['typename'] end |
Instance Attribute Details
#typename ⇒ Object (readonly)
Returns the value of attribute typename.
4 5 6 |
# File 'lib/ssource/source/variable.rb', line 4 def typename @typename end |
Instance Method Details
#pretty_print ⇒ Object
14 15 16 |
# File 'lib/ssource/source/variable.rb', line 14 def pretty_print to_hash end |
#to_hash ⇒ Object
10 11 12 |
# File 'lib/ssource/source/variable.rb', line 10 def to_hash "#{name}: #{typename}" end |