Class: Arel::Nodes::Ascending
- Inherits:
-
Ordering
- Object
- Ordering
- Arel::Nodes::Ascending
- Defined in:
- ext/arel/nodes/ascending.rb
Instance Attribute Summary collapse
-
#nulls ⇒ Object
Returns the value of attribute nulls.
Instance Method Summary collapse
-
#initialize(expr, nulls = nil) ⇒ Ascending
constructor
A new instance of Ascending.
- #reverse ⇒ Object
Constructor Details
#initialize(expr, nulls = nil) ⇒ Ascending
Returns a new instance of Ascending.
7 8 9 10 |
# File 'ext/arel/nodes/ascending.rb', line 7 def initialize expr, nulls=nil super(expr) @nulls = nulls end |
Instance Attribute Details
#nulls ⇒ Object
Returns the value of attribute nulls.
5 6 7 |
# File 'ext/arel/nodes/ascending.rb', line 5 def nulls @nulls end |
Instance Method Details
#reverse ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'ext/arel/nodes/ascending.rb', line 12 def reverse reverse_nulls = if nulls == :nulls_first :nulls_last elsif nulls :nulls_first else nil end Descending.new(expr, reverse_nulls) end |