Class: OrderedByExpr

Inherits:
Object
  • Object
show all
Defined in:
lib/lilit_sql.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(expr, direction = nil) ⇒ OrderedByExpr



72
73
74
75
# File 'lib/lilit_sql.rb', line 72

def initialize(expr, direction = nil)
  @expr = expr
  @direction = direction
end

Instance Attribute Details

#directionObject

Returns the value of attribute direction.



70
71
72
# File 'lib/lilit_sql.rb', line 70

def direction
  @direction
end

#exprObject

Returns the value of attribute expr.



70
71
72
# File 'lib/lilit_sql.rb', line 70

def expr
  @expr
end

Instance Method Details

#sqlObject



77
78
79
80
81
82
83
# File 'lib/lilit_sql.rb', line 77

def sql
  s = @expr.ref_sql

  if @direction
    s += " #{direction}"
  end
end