Class: Loxxy::BackEnd::Variable
- Inherits:
-
Object
- Object
- Loxxy::BackEnd::Variable
- Includes:
- Entry
- Defined in:
- lib/loxxy/back_end/variable.rb
Overview
Representation of a Lox variable. It is a named slot that can be associated with a value at the time.
Instance Attribute Summary collapse
-
#value ⇒ Datatype::BuiltinDatatype
readonly
The value assigned to the variable.
Attributes included from Entry
Instance Method Summary collapse
- #assign(aValue) ⇒ Object
-
#initialize(aName, aValue = Datatype::Nil.instance) ⇒ Variable
constructor
Create a variable with given name and initial value.
Methods included from Entry
Constructor Details
Instance Attribute Details
#value ⇒ Datatype::BuiltinDatatype (readonly)
Returns the value assigned to the variable.
14 15 16 |
# File 'lib/loxxy/back_end/variable.rb', line 14 def value @value end |
Instance Method Details
#assign(aValue) ⇒ Object
25 26 27 |
# File 'lib/loxxy/back_end/variable.rb', line 25 def assign(aValue) @value = aValue end |