I'm confused as to how the sort method works.

If I have:
a = [ "d", "a", "e", "c", "b" ]

I know that
a.sort {|x,y| x <=> y } (or just .sort)
= ["a", "b", "c", "d", "e"]

and
a.sort {|x,y| y <=> x }
= ["e", "d", "c", "b", "a"]

I understand how the <=> operator works, but what exactly is going on in
the block? What are x and y assigned to?
-- 
Posted via http://www.ruby-forum.com/.