Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- h = Hash.new
- h['x'] = Hash.new if not h.key?('x')
- h['x']['y'] = value_to_insert
- h = Hash.new
- h['x']['y'] = value_to_insert
- looked_up_value = h['w']['z']
- h = Hash.new { |h, k| h[k] = Hash.new }
- hash = Hash.new(&(p=lambda{|h,k| h[k] = Hash.new(&p)}))
- ((h ||= { })['w'] ||= { })['z']
Add Comment
Please, Sign In to add comment