Class: Namarara::NumberValue
- Defined in:
- lib/namarara/parser.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Attributes inherited from TreeValue
Instance Method Summary collapse
- #compute ⇒ Object
-
#initialize(str) ⇒ NumberValue
constructor
A new instance of NumberValue.
- #to_s ⇒ Object
Constructor Details
#initialize(str) ⇒ NumberValue
Returns a new instance of NumberValue.
47 48 49 50 |
# File 'lib/namarara/parser.rb', line 47 def initialize(str) @errors = [] @value = str end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
45 46 47 |
# File 'lib/namarara/parser.rb', line 45 def errors @errors end |
Instance Method Details
#compute ⇒ Object
52 53 54 |
# File 'lib/namarara/parser.rb', line 52 def compute @value end |
#to_s ⇒ Object
56 57 58 |
# File 'lib/namarara/parser.rb', line 56 def to_s "number:#{@value}" end |