Class: Squeel::Nodes::Operation
- Defined in:
- lib/squeel/nodes/operation.rb
Overview
An Operation is basically a function with its operands limited, and rearranged, so Squeel implements it as such.
Instance Attribute Summary
Attributes inherited from Function
Instance Method Summary collapse
-
#initialize(left, operator, right) ⇒ Operation
constructor
Create a new Operation with the given operator and left and right operands.
-
#left ⇒ Object
The left operand.
-
#right ⇒ Object
The right operand.
Methods inherited from Function
Methods included from Operators
Constructor Details
#initialize(left, operator, right) ⇒ Operation
Create a new Operation with the given operator and left and right operands
13 14 15 |
# File 'lib/squeel/nodes/operation.rb', line 13 def initialize(left, operator, right) super(operator, [left, right]) end |
Instance Method Details
#left ⇒ Object
Returns The left operand.
21 22 23 |
# File 'lib/squeel/nodes/operation.rb', line 21 def left args[0] end |
#right ⇒ Object
Returns The right operand.
26 27 28 |
# File 'lib/squeel/nodes/operation.rb', line 26 def right args[1] end |