Class: ValueExpression
- Inherits:
-
Arity1Operators
- Object
- Operator
- Arity1Operators
- ValueExpression
- Defined in:
- lib/lamep/Expressions/value_expression.rb
Constant Summary
Constants inherited from Arity1Operators
Constants inherited from Operator
Instance Attribute Summary
Attributes inherited from Arity1Operators
Instance Method Summary collapse
- #evaluate(attributes = {}) ⇒ Object
-
#initialize(operand) ⇒ ValueExpression
constructor
A new instance of ValueExpression.
- #to_sql ⇒ Object
Methods inherited from Arity1Operators
Methods inherited from Operator
exists?, factory!, operator, precedence!, register
Constructor Details
#initialize(operand) ⇒ ValueExpression
Returns a new instance of ValueExpression.
3 4 5 |
# File 'lib/lamep/Expressions/value_expression.rb', line 3 def initialize(operand) @operand = operand end |
Instance Method Details
#evaluate(attributes = {}) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/lamep/Expressions/value_expression.rb', line 11 def evaluate(attributes = {}) if attributes.key? @operand attributes[@operand] else @operand end end |
#to_sql ⇒ Object
7 8 9 |
# File 'lib/lamep/Expressions/value_expression.rb', line 7 def to_sql operand end |