Quantcast
Channel: I On Rails
Viewing all articles
Browse latest Browse all 10

How to initialize an Array of Hashes in Ruby

$
0
0

How to initialize an array of hashes. Each value of keys within the hash will initially consist of an empty array:


your_hash = Hash.new {|h,k| h[k] = [] }


Viewing all articles
Browse latest Browse all 10

Trending Articles