Class: Namarara::NumberValue

Inherits:
TreeValue show all
Defined in:
lib/namarara/parser.rb

Instance Attribute Summary collapse

Attributes inherited from TreeValue

#value

Instance Method Summary collapse

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

#errorsObject (readonly)

Returns the value of attribute errors.



45
46
47
# File 'lib/namarara/parser.rb', line 45

def errors
  @errors
end

Instance Method Details

#computeObject



52
53
54
# File 'lib/namarara/parser.rb', line 52

def compute
  @value
end

#to_sObject



56
57
58
# File 'lib/namarara/parser.rb', line 56

def to_s
  "number:#{@value}"
end