Class: Sol::FuncNode
- Inherits:
-
Struct
- Object
- Struct
- Sol::FuncNode
- Defined in:
- lib/sol/nodes.rb,
lib/sol/interpreter.rb
Overview
Method definition.
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
73 74 75 |
# File 'lib/sol/nodes.rb', line 73 def body @body end |
#name ⇒ Object
Returns the value of attribute name
73 74 75 |
# File 'lib/sol/nodes.rb', line 73 def name @name end |
#params ⇒ Object
Returns the value of attribute params
73 74 75 |
# File 'lib/sol/nodes.rb', line 73 def params @params end |
Instance Method Details
#eval(context) ⇒ Object
161 162 163 164 165 166 167 168 |
# File 'lib/sol/interpreter.rb', line 161 def eval(context) # Defining a method is adding a method to the current class method = RuntimeModel::SolFunction.new(params, body) RuntimeModel::Runtime.current_class.runtime_methods[name] = method # I think this works end |