Class: OrderedByExpr
- Inherits:
-
Object
- Object
- OrderedByExpr
- Defined in:
- lib/lilit_sql.rb
Instance Attribute Summary collapse
-
#direction ⇒ Object
Returns the value of attribute direction.
-
#expr ⇒ Object
Returns the value of attribute expr.
Instance Method Summary collapse
-
#initialize(expr, direction = nil) ⇒ OrderedByExpr
constructor
A new instance of OrderedByExpr.
- #sql ⇒ Object
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
#direction ⇒ Object
Returns the value of attribute direction.
70 71 72 |
# File 'lib/lilit_sql.rb', line 70 def direction @direction end |
#expr ⇒ Object
Returns the value of attribute expr.
70 71 72 |
# File 'lib/lilit_sql.rb', line 70 def expr @expr end |
Instance Method Details
#sql ⇒ Object
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 |