Guest User

Untitled

a guest
Jan 18th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. irb(main):001:0> require 'pry'
  2. => true
  3. irb(main):002:0> pry
  4. [1] pry(main)> magic = Hash.new({})
  5. => {}
  6. [2] pry(main)> magic['bird'] = 'in the hat'
  7. => "in the hat"
  8. [3] pry(main)> magic.keys
  9. => ["bird"]
  10. [4] pry(main)> magic['watch']['closely'] = 'this is the trick'
  11. => "this is the trick"
  12. [5] pry(main)> magic.keys
  13. => ["bird"]
  14. [6] pry(main)> magic['out']['of nowhere'] = magic['watch']['closely']
  15. => "this is the trick"
  16. [7] pry(main)> magic.keys
  17. => ["bird"]
  18. [8] pry(main)> magic['out']['of nowhere']
  19. => "this is the trick"
  20. [9] pry(main)>
Add Comment
Please, Sign In to add comment