Class: Sequel::SQL::ColumnExpr

Inherits:
Expression show all
Defined in:
lib/sequel/core_sql.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Expression

#lit

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

#lObject (readonly)

Returns the value of attribute l.



67
68
69
# File 'lib/sequel/core_sql.rb', line 67

def l
  @l
end

#opObject (readonly)

Returns the value of attribute op.



67
68
69
# File 'lib/sequel/core_sql.rb', line 67

def op
  @op
end

#rObject (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