Sebastian Hungerecker
12/12/2007 8:24:00 PM
Nigama Xx wrote:
> def sort some_array
...
> puts a.sort
You're defining Object#sort(some_array), but you're calling Enumerable#sort().
You'd call your method by writing sort(a) not a.sort. If you'd want to call it
via a.my_sort, you'd have to define it like
module Enumerable # or class Array
def sort
...
end
end
HTH,
Sebastian
--
Jabber: sepp2k@jabber.org
ICQ: 205544826