ruby on rails - RoR free element from array -


i have element in array such that,

[#<name id: 23, first_name: "anderson", last_name: "gorge">] 

how can remove array block, want as

#<name id: 23, first_name: "anderson", last_name: "gorge"> 

without array block

do mean have a single element in array , want extract it? there many ways of doing it, 2 come mind are:

>> obj = [#<name id: 23, first_name: "anderson", last_name: "gorge">].first => #<name id: 23, first_name: "anderson", last_name: "gorge"> >> obj = [#<name id: 23, first_name: "anderson", last_name: "gorge">].shift => #<name id: 23, first_name: "anderson", last_name: "gorge"> 

Comments

Popular posts from this blog

silverlight - Applying a style to ItemContainerStyle in C# -

php - Retrieving comment count from fb:comments widget (Facebook) -

c# - NullReferenceException in MySqlClient.NativeDriver -