Class: Arity1Operators
- Defined in:
- lib/lamep/Expressions/arity1_operators.rb
Direct Known Subclasses
Constant Summary collapse
- ARITY =
1
Constants inherited from Operator
Instance Attribute Summary collapse
-
#operand ⇒ Object
readonly
Returns the value of attribute operand.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #equal?)
-
#initialize(operand) ⇒ Arity1Operators
constructor
A new instance of Arity1Operators.
Methods inherited from Operator
exists?, factory!, operator, precedence!, register, #to_sql
Constructor Details
#initialize(operand) ⇒ Arity1Operators
Returns a new instance of Arity1Operators.
10 11 12 |
# File 'lib/lamep/Expressions/arity1_operators.rb', line 10 def initialize(operand) @operand = (operand.is_a?(Operator)) ? operand : ValueExpression.new(operand) end |
Instance Attribute Details
#operand ⇒ Object (readonly)
Returns the value of attribute operand.
3 4 5 |
# File 'lib/lamep/Expressions/arity1_operators.rb', line 3 def operand @operand end |
Instance Method Details
#==(other) ⇒ Object Also known as: equal?
6 7 8 |
# File 'lib/lamep/Expressions/arity1_operators.rb', line 6 def ==(other) other.class == self.class && other.operand == @operand end |