Class: Sequel::SQL::ColumnExpr
- Inherits:
-
Expression
- Object
- Expression
- Sequel::SQL::ColumnExpr
- Defined in:
- lib/sequel/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.
68 |
# File 'lib/sequel/core_sql.rb', line 68 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.
67 68 69 |
# File 'lib/sequel/core_sql.rb', line 67 def l @l end |
#op ⇒ Object (readonly)
Returns the value of attribute op.
67 68 69 |
# File 'lib/sequel/core_sql.rb', line 67 def op @op end |
#r ⇒ Object (readonly)
Returns the value of attribute r.
67 68 69 |
# File 'lib/sequel/core_sql.rb', line 67 def r @r end |
Instance Method Details
#to_s(ds) ⇒ Object
70 71 72 73 74 |
# File 'lib/sequel/core_sql.rb', line 70 def to_s(ds) @r ? \ "#{ds.literal(@l)} #{@op} #{ds.literal(@r)}" : \ "#{ds.literal(@l)} #{@op}" end |