Class: Criteria::Order
- Inherits:
-
Object
- Object
- Criteria::Order
- Defined in:
- lib/criteria.rb
Overview
This class reprsents an ordering by a particular column. The normal way to retreive and instance of this object is by calling the direction on the Column instance, e.g. User.email.asc
Constant Summary collapse
- ASC =
"ASC"
- DESC =
"DESC"
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#dir ⇒ Object
readonly
Returns the value of attribute dir.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(column, dir = ASC) ⇒ Order
constructor
A new instance of Order.
- #to_s ⇒ Object
Constructor Details
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
208 209 210 |
# File 'lib/criteria.rb', line 208 def column @column end |
#dir ⇒ Object (readonly)
Returns the value of attribute dir.
208 209 210 |
# File 'lib/criteria.rb', line 208 def dir @dir end |
Class Method Details
Instance Method Details
#to_s ⇒ Object
217 218 219 |
# File 'lib/criteria.rb', line 217 def to_s "#{@column.to_sql_name} #{@dir}" end |