Class: LanguageParser::ClassVariable
- Inherits:
-
Object
- Object
- LanguageParser::ClassVariable
- Defined in:
- lib/cgialib/lp/Language.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#comment ⇒ Object
The comment surrounding the variable.
-
#const ⇒ Object
True if it’s const.
-
#name ⇒ Object
The name of the variable.
-
#static ⇒ Object
True if it’s static.
-
#type ⇒ Object
The type of the variable.
-
#value ⇒ Object
The value of the variable.
-
#visibility ⇒ Object
“public”, “private” or “protected”.
Instance Method Summary collapse
-
#initialize ⇒ ClassVariable
constructor
initialize().
-
#to_s ⇒ Object
to_s().
Constructor Details
#initialize ⇒ ClassVariable
initialize()
Constructor
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/cgialib/lp/Language.rb', line 18 def initialize() @name = nil @type = nil @static = false @const = false @visibility = nil @value = nil @comment = "" end |
Instance Attribute Details
#comment ⇒ Object
The comment surrounding the variable
42 43 44 |
# File 'lib/cgialib/lp/Language.rb', line 42 def comment @comment end |
#const ⇒ Object
True if it’s const
36 37 38 |
# File 'lib/cgialib/lp/Language.rb', line 36 def const @const end |
#name ⇒ Object
The name of the variable
30 31 32 |
# File 'lib/cgialib/lp/Language.rb', line 30 def name @name end |
#static ⇒ Object
True if it’s static
34 35 36 |
# File 'lib/cgialib/lp/Language.rb', line 34 def static @static end |
#type ⇒ Object
The type of the variable
32 33 34 |
# File 'lib/cgialib/lp/Language.rb', line 32 def type @type end |
#value ⇒ Object
The value of the variable
40 41 42 |
# File 'lib/cgialib/lp/Language.rb', line 40 def value @value end |
#visibility ⇒ Object
“public”, “private” or “protected”
38 39 40 |
# File 'lib/cgialib/lp/Language.rb', line 38 def visibility @visibility end |
Instance Method Details
#to_s ⇒ Object
to_s()
Pretty printing the variable
48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/cgialib/lp/Language.rb', line 48 def to_s() text = "#{name} - #{type}" text += " - #{@visibility}" if ( @visibility ) text += " - const" if ( @const ) text += " - static" if ( @static ) text += " = #{@value}" if ( @value ) text end |