Class: DefNode
- Inherits:
-
Struct
- Object
- Struct
- DefNode
- 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.
-
#params ⇒ Object
Returns the value of attribute params.
Instance Method Summary collapse
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body
42 43 44 |
# File 'lib/turmali/nodes.rb', line 42 def body @body end |
#name ⇒ Object
Returns the value of attribute name
42 43 44 |
# File 'lib/turmali/nodes.rb', line 42 def name @name end |
#params ⇒ Object
Returns the value of attribute params
42 43 44 |
# File 'lib/turmali/nodes.rb', line 42 def params @params end |
Instance Method Details
#eval(context) ⇒ Object
96 97 98 99 |
# File 'lib/turmali/interpreter.rb', line 96 def eval(context) method = TurmaliMethod.new(params, body) context.current_class.runtime_methods[name] = method end |