Class: OrderQuery::SQL::OrderBy
- Inherits:
-
Object
- Object
- OrderQuery::SQL::OrderBy
- Defined in:
- lib/order_query/sql/order_by.rb
Overview
Constructs SQL for ORDER BY.
Instance Method Summary collapse
- #build ⇒ String
- #build_reverse ⇒ String
-
#initialize(columns) ⇒ OrderBy
constructor
A new instance of OrderBy.
Constructor Details
#initialize(columns) ⇒ OrderBy
Returns a new instance of OrderBy.
8 9 10 |
# File 'lib/order_query/sql/order_by.rb', line 8 def initialize(columns) @columns = columns end |
Instance Method Details
#build ⇒ String
13 14 15 |
# File 'lib/order_query/sql/order_by.rb', line 13 def build @sql ||= join_order_by_clauses order_by_sql_clauses end |
#build_reverse ⇒ String
18 19 20 |
# File 'lib/order_query/sql/order_by.rb', line 18 def build_reverse @reverse_sql ||= join_order_by_clauses order_by_sql_clauses(true) end |