Class: Kalc::Ast::FunctionCall
- Inherits:
-
Object
- Object
- Kalc::Ast::FunctionCall
- Defined in:
- lib/kalc/ast.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#variable_list ⇒ Object
readonly
Returns the value of attribute variable_list.
Instance Method Summary collapse
- #eval(context) ⇒ Object
-
#initialize(name, variable_list) ⇒ FunctionCall
constructor
A new instance of FunctionCall.
Constructor Details
#initialize(name, variable_list) ⇒ FunctionCall
Returns a new instance of FunctionCall.
241 242 243 244 |
# File 'lib/kalc/ast.rb', line 241 def initialize(name, variable_list) @name = name @variable_list = variable_list end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
238 239 240 |
# File 'lib/kalc/ast.rb', line 238 def name @name end |
#variable_list ⇒ Object (readonly)
Returns the value of attribute variable_list.
239 240 241 |
# File 'lib/kalc/ast.rb', line 239 def variable_list @variable_list end |
Instance Method Details
#eval(context) ⇒ Object
246 247 248 249 |
# File 'lib/kalc/ast.rb', line 246 def eval(context) to_call = context.get_function(@name) to_call.call(context, *@variable_list) if to_call end |