Class: Sequel::SQL::ColumnExpr
- Inherits:
-
Expression
- Object
- Expression
- Sequel::SQL::ColumnExpr
- Defined in:
- lib/sequel_core/core_sql.rb
Instance Attribute Summary collapse
-
#l ⇒ Object
readonly
Returns the value of attribute l.
-
#op ⇒ Object
readonly
Returns the value of attribute op.
-
#r ⇒ Object
readonly
Returns the value of attribute r.
Instance Method Summary collapse
-
#initialize(l, op, r = nil) ⇒ ColumnExpr
constructor
A new instance of ColumnExpr.
- #to_s(ds) ⇒ Object
Methods inherited from Expression
Constructor Details
#initialize(l, op, r = nil) ⇒ ColumnExpr
Returns a new instance of ColumnExpr.
76 |
# File 'lib/sequel_core/core_sql.rb', line 76 def initialize(l, op, r = nil); @l, @op, @r = l, op, r; end |
Instance Attribute Details
#l ⇒ Object (readonly)
Returns the value of attribute l.
75 76 77 |
# File 'lib/sequel_core/core_sql.rb', line 75 def l @l end |
#op ⇒ Object (readonly)
Returns the value of attribute op.
75 76 77 |
# File 'lib/sequel_core/core_sql.rb', line 75 def op @op end |
#r ⇒ Object (readonly)
Returns the value of attribute r.
75 76 77 |
# File 'lib/sequel_core/core_sql.rb', line 75 def r @r end |
Instance Method Details
#to_s(ds) ⇒ Object
78 79 80 81 82 |
# File 'lib/sequel_core/core_sql.rb', line 78 def to_s(ds) @r ? \ "#{ds.literal(@l)} #{@op} #{ds.literal(@r)}" : \ "#{ds.literal(@l)} #{@op}" end |