Class: ClassNode
- Inherits:
-
Struct
- Object
- Struct
- ClassNode
- Defined in:
- lib/turmali/nodes.rb,
lib/turmali/interpreter.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body
44 45 46 |
# File 'lib/turmali/nodes.rb', line 44 def body @body end |
#name ⇒ Object
Returns the value of attribute name
44 45 46 |
# File 'lib/turmali/nodes.rb', line 44 def name @name end |
Instance Method Details
#eval(context) ⇒ Object
103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/turmali/interpreter.rb', line 103 def eval(context) turmali_class = Constants[name] unless turmali_class turmali_class = TurmaliClass.new Constants[name] = turmali_class end class_context = Context.new(turmali_class, turmali_class) body.eval(class_context) turmali_class end |