Class: Sequel::SQL::ColumnExpr

Inherits:
Expression show all
Defined in:
lib/sequel_core/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.



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

#lObject (readonly)

Returns the value of attribute l.



75
76
77
# File 'lib/sequel_core/core_sql.rb', line 75

def l
  @l
end

#opObject (readonly)

Returns the value of attribute op.



75
76
77
# File 'lib/sequel_core/core_sql.rb', line 75

def op
  @op
end

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