From: Tushar Gandhi Date: 2008-08-19T19:15:17+09:00 Subject: Re: Array API Frederick Cheung wrote: > On 19 Aug 2008, at 10:06, Tushar Gandhi wrote: > >> Hi, >> I am going through the ruby Array API. In the API , there is >> staetment >> >> Included Modules >> Enumerable >> >> Is this means that we are inheriting the enumerable class to array? >> > Not inheriting. That means the Enumerable module is mixed in to Array > (and similarly to Hash and other collections) > >> How it is possible that we are able to use enumerable sort_by method >> for >> an array of object? >> > Because that's what including a module does: it adds the methods > defined in the module to the class. > > Fred Hi, Is sort_by method will cause performance problem? or Is it faster sort? -- Posted via http://www.ruby-forum.com/.