Houen's Blog

Thoughts on life, startups, tech & code

Ruby Map Array to Hash (Also Rails)

Ruby Map Array to Hash

map-array-to-hash

Sometimes you need to map array value to a hash structure. It could be that you have a set of keys, and you want to map some¬†values related to those keys to a hash in order to return it from a function. Or something else, what do I know. But I do know a nice, clean way to do it: (more…)

Get email about new posts

Get the latest posts delivered to your mailbox: