Class: FormulaDSL::FunctionExpression
- Inherits:
-
Object
- Object
- FormulaDSL::FunctionExpression
- Defined in:
- lib/formula_dsl/function_expression.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #apply ⇒ Object
-
#initialize(name, *args) ⇒ FunctionExpression
constructor
A new instance of FunctionExpression.
Constructor Details
#initialize(name, *args) ⇒ FunctionExpression
Returns a new instance of FunctionExpression.
6 7 8 9 |
# File 'lib/formula_dsl/function_expression.rb', line 6 def initialize(name, *args) @name = name @args = args end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
5 6 7 |
# File 'lib/formula_dsl/function_expression.rb', line 5 def args @args end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/formula_dsl/function_expression.rb', line 5 def name @name end |
Instance Method Details
#==(other) ⇒ Object
17 18 19 |
# File 'lib/formula_dsl/function_expression.rb', line 17 def == (other) @name == other.name && @args == other.args end |
#apply ⇒ Object
11 12 13 14 15 |
# File 'lib/formula_dsl/function_expression.rb', line 11 def apply function = FunctionExpressionFactory.new(@name) function.call(@args) end |