Class: Zaid::Nodes::ClassNode
- Inherits:
-
Struct
- Object
- Struct
- Zaid::Nodes::ClassNode
- Defined in:
- lib/zaid/nodes/class_node.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
5 6 7 |
# File 'lib/zaid/nodes/class_node.rb', line 5 def body @body end |
#name ⇒ Object
Returns the value of attribute name
5 6 7 |
# File 'lib/zaid/nodes/class_node.rb', line 5 def name @name end |
Instance Method Details
#eval(_context) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/zaid/nodes/class_node.rb', line 6 def eval(_context) zaid_class = Constants[name] unless zaid_class zaid_class = Runtime::ZaidClass.new(Constants['شيء']) Constants[name] = zaid_class end class_context = Runtime::Context.new(zaid_class, zaid_class) body.eval(class_context) zaid_class end |