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

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -