Class: Reverser
Instance Attribute Summary collapse
-
#obj ⇒ Object
Returns the value of attribute obj.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(obj) ⇒ Reverser
constructor
A new instance of Reverser.
Constructor Details
#initialize(obj) ⇒ Reverser
Returns a new instance of Reverser.
6 7 8 |
# File 'lib/support/sort_by_attributes.rb', line 6 def initialize(obj) @obj = obj end |
Instance Attribute Details
#obj ⇒ Object
Returns the value of attribute obj.
4 5 6 |
# File 'lib/support/sort_by_attributes.rb', line 4 def obj @obj end |
Instance Method Details
#<=>(other) ⇒ Object
10 11 12 |
# File 'lib/support/sort_by_attributes.rb', line 10 def <=>(other) other.obj <=> self.obj end |