Class: Halunke::NumberNode
- Inherits:
-
Struct
- Object
- Struct
- Halunke::NumberNode
- Defined in:
- lib/halunke/nodes.rb
Instance Attribute Summary collapse
-
#te ⇒ Object
Returns the value of attribute te.
-
#ts ⇒ Object
Returns the value of attribute ts.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
Instance Attribute Details
#te ⇒ Object
Returns the value of attribute te
12 13 14 |
# File 'lib/halunke/nodes.rb', line 12 def te @te end |
#ts ⇒ Object
Returns the value of attribute ts
12 13 14 |
# File 'lib/halunke/nodes.rb', line 12 def ts @ts end |
#value ⇒ Object
Returns the value of attribute value
12 13 14 |
# File 'lib/halunke/nodes.rb', line 12 def value @value end |
Instance Method Details
#==(other) ⇒ Object
18 19 20 21 |
# File 'lib/halunke/nodes.rb', line 18 def ==(other) other.is_a?(NumberNode) && value == other.value end |
#eval(context) ⇒ Object
13 14 15 16 |
# File 'lib/halunke/nodes.rb', line 13 def eval(context) context["Number"].create_instance(value, source_code_position: source_code_position) end |
#source_code_position ⇒ Object
23 24 25 |
# File 'lib/halunke/nodes.rb', line 23 def source_code_position SourceCodePosition.new(ts, te) end |