Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- irb(main):001:0> require 'pry'
- => true
- irb(main):002:0> pry
- [1] pry(main)> magic = Hash.new({})
- => {}
- [2] pry(main)> magic['bird'] = 'in the hat'
- => "in the hat"
- [3] pry(main)> magic.keys
- => ["bird"]
- [4] pry(main)> magic['watch']['closely'] = 'this is the trick'
- => "this is the trick"
- [5] pry(main)> magic.keys
- => ["bird"]
- [6] pry(main)> magic['out']['of nowhere'] = magic['watch']['closely']
- => "this is the trick"
- [7] pry(main)> magic.keys
- => ["bird"]
- [8] pry(main)> magic['out']['of nowhere']
- => "this is the trick"
- [9] pry(main)>
Add Comment
Please, Sign In to add comment