T
Tushar Gandhi
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?
Also there is sort_by method for the enumerable object, but I am able to
use this method for array of object.
I have this type of array of Object:-
[#<UserDemo:0x89a5bd4 @attributes={"email3"=>nil, "lastname"=>"aikhe",
"firstname"=>"mita", "id"=>"1"}>,#<UserDemo:0x89a5bd4
@attributes={"email3"=>nil, "lastname"=>"aikhe", "firstname"=>"na",
"id"=>"2"}>]
How it is possible that we are able to use enumerable sort_by method for
an array of object?
Thanks & Regards,
Tushar
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?
Also there is sort_by method for the enumerable object, but I am able to
use this method for array of object.
I have this type of array of Object:-
[#<UserDemo:0x89a5bd4 @attributes={"email3"=>nil, "lastname"=>"aikhe",
"firstname"=>"mita", "id"=>"1"}>,#<UserDemo:0x89a5bd4
@attributes={"email3"=>nil, "lastname"=>"aikhe", "firstname"=>"na",
"id"=>"2"}>]
How it is possible that we are able to use enumerable sort_by method for
an array of object?
Thanks & Regards,
Tushar