Class: Reverser

Inherits:
Object show all
Defined in:
lib/support/sort_by_attributes.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#objObject

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