paco.onrails | 18 Jul 17:17

create an array from a hash that includes key and value


Hello there, I have the hash:

@hash = {"a"=>"1", "b"=>"2", "c"=>"3"}

And I need to create an array:

@array = [ ['a','1'],['b','2'],['c','3'] ]

How do I do that?

Paco Reyes

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@...
To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Gmane