Things to know for effective coding
Posted (Amit) in Ruby on Rails on 23-06-2008
Requires Ruby 1.8.7 or higher.
1 2 3 4 5 6
keys = [1,2,[3,4]] [1, 2, [3, 4]] values = ['a','b',['c','d']] ["a", "b", ["c", "d"]] Hash[ * keys.zip(values).flatten(1) ] {1=>"a", [3, 4] => ["c", "d"], 2 => "b"}
Name (required)
Mail (will not be published) (required)
Website
Email address:
Delivered by FeedBurner
Amit Yadav is Digg proof thanks to caching by WP Super Cache