Class: UnaryOperation
Instance Attribute Summary collapse
-
#op ⇒ Object
Returns the value of attribute op.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(op, value) ⇒ UnaryOperation
constructor
A new instance of UnaryOperation.
- #ref_sql ⇒ Object
- #state ⇒ Object
Methods inherited from Expr
#*, #+, #<, #<=, #>, #>=, #and, #asc, #desc, #eq, #in, #minus, #ne, #not, #plus
Constructor Details
#initialize(op, value) ⇒ UnaryOperation
Returns a new instance of UnaryOperation.
89 90 91 92 |
# File 'lib/lilit_sql.rb', line 89 def initialize(op, value) @op = op @value = value end |
Instance Attribute Details
#op ⇒ Object
Returns the value of attribute op.
87 88 89 |
# File 'lib/lilit_sql.rb', line 87 def op @op end |
Instance Method Details
#==(other) ⇒ Object
98 99 100 |
# File 'lib/lilit_sql.rb', line 98 def ==(other) other.class == self.class && other.state == state end |
#ref_sql ⇒ Object
94 95 96 |
# File 'lib/lilit_sql.rb', line 94 def ref_sql "#{@op} (#{@value.ref_sql})" end |
#state ⇒ Object
102 103 104 |
# File 'lib/lilit_sql.rb', line 102 def state instance_variables.map { |variable| instance_variable_get variable } end |