From: RichardOnRails Date: 2011-04-21T13:15:50+09:00 Subject: Using the spaceship operator Hi, Here an abstract version of my app, in which I have an array of two- element arrays I'd like to sort on the second element of each pair using the spaceship operator: $data = [ [:A, 12], [:B, 30], [:C, 4] ] Class MyTest < Array def <=>(other) self[1] <=> other[1] end @sorted_array = $date end How can I make this work? Thanks in advance, Richard