Class: Halunke::BarewordNode
- Inherits:
-
Struct
- Object
- Struct
- Halunke::BarewordNode
- 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
44 45 46 |
# File 'lib/halunke/nodes.rb', line 44 def te @te end |
#ts ⇒ Object
Returns the value of attribute ts
44 45 46 |
# File 'lib/halunke/nodes.rb', line 44 def ts @ts end |
#value ⇒ Object
Returns the value of attribute value
44 45 46 |
# File 'lib/halunke/nodes.rb', line 44 def value @value end |
Instance Method Details
#==(other) ⇒ Object
51 52 53 54 |
# File 'lib/halunke/nodes.rb', line 51 def ==(other) other.is_a?(BarewordNode) && value == other.value end |
#eval(context) ⇒ Object
45 46 47 48 49 |
# File 'lib/halunke/nodes.rb', line 45 def eval(context) context[value] rescue KeyError raise HUnassignedBareword.new("Bareword '#{value} is unassigned", source_code_position) end |
#source_code_position ⇒ Object
56 57 58 |
# File 'lib/halunke/nodes.rb', line 56 def source_code_position SourceCodePosition.new(ts, te) end |