Class: Steamd::Generator::Variable
- Inherits:
-
Object
- Object
- Steamd::Generator::Variable
- Defined in:
- lib/steamd/generator/generated_class.rb
Overview
Represents an class variable from the Generator
Direct Known Subclasses
Instance Attribute Summary collapse
-
#modifier ⇒ Object
readonly
The variable modifier.
-
#modifier_size ⇒ String
readonly
The size of the variable modifier.
-
#name ⇒ String
readonly
The name of the Variable.
-
#size ⇒ Object
readonly
The variable size.
-
#type ⇒ Object
readonly
The type of the variable.
-
#value ⇒ Object
readonly
The variable value.
Instance Method Summary collapse
-
#initialize(opts) ⇒ Variable
constructor
Create a new GeneratedClass.
-
#to_hash ⇒ Object
(also: #to_h)
Return the variable as a hash.
Constructor Details
#initialize(opts) ⇒ Variable
Create a new GeneratedClass
26 27 28 29 30 31 32 |
# File 'lib/steamd/generator/generated_class.rb', line 26 def initialize(opts) @name = opts[:name] @value = opts[:value] @type = opts[:type] @modifier = opts[:modifier] @modifier_size = opts[:modifier_size] end |
Instance Attribute Details
#modifier ⇒ Object (readonly)
The variable modifier
17 18 19 |
# File 'lib/steamd/generator/generated_class.rb', line 17 def modifier @modifier end |
#modifier_size ⇒ String (readonly)
The size of the variable modifier
20 21 22 |
# File 'lib/steamd/generator/generated_class.rb', line 20 def modifier_size @modifier_size end |
#name ⇒ String (readonly)
The name of the Variable
8 9 10 |
# File 'lib/steamd/generator/generated_class.rb', line 8 def name @name end |
#size ⇒ Object (readonly)
The variable size
14 15 16 |
# File 'lib/steamd/generator/generated_class.rb', line 14 def size @size end |
#type ⇒ Object (readonly)
The type of the variable
11 12 13 |
# File 'lib/steamd/generator/generated_class.rb', line 11 def type @type end |
#value ⇒ Object (readonly)
The variable value
23 24 25 |
# File 'lib/steamd/generator/generated_class.rb', line 23 def value @value end |
Instance Method Details
#to_hash ⇒ Object Also known as: to_h
Return the variable as a hash
75 76 77 78 79 80 81 82 83 84 |
# File 'lib/steamd/generator/generated_class.rb', line 75 def to_hash { name: name, type: type, modifier: modifier, value: value, size: size, modifier_size: modifier_size } end |