Class: ActiveEnumerable::Order::DESC
- Inherits:
-
Object
- Object
- ActiveEnumerable::Order::DESC
- Defined in:
- lib/active_enumerable/order.rb
Instance Attribute Summary collapse
-
#r ⇒ Object
readonly
Returns the value of attribute r.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(r) ⇒ DESC
constructor
A new instance of DESC.
Constructor Details
#initialize(r) ⇒ DESC
Returns a new instance of DESC.
39 40 41 |
# File 'lib/active_enumerable/order.rb', line 39 def initialize(r) @r = r end |
Instance Attribute Details
#r ⇒ Object (readonly)
Returns the value of attribute r.
37 38 39 |
# File 'lib/active_enumerable/order.rb', line 37 def r @r end |
Instance Method Details
#<=>(other) ⇒ Object
43 44 45 |
# File 'lib/active_enumerable/order.rb', line 43 def <=>(other) -(r <=> other.r) # Flip negative/positive result end |