Advertisement
Guest User

Untitled

a guest
Jul 10th, 2017
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. 2.4.1 :005 > x = {a: {foo: 'foo'}}.freeze
  2. => {:a=>{:foo=>"foo"}}
  3. 2.4.1 :006 > x.delete(:a)
  4. RuntimeError: can't modify frozen Hash
  5. from (irb):6:in `delete'
  6. from (irb):6
  7. from /home/greg/.rvm/rubies/ruby-2.4.1/bin/irb:11:in `<main>'
  8. 2.4.1 :007 > x[:a].delete(:foo)
  9. => "foo"
  10. 2.4.1 :008 > x
  11. => {:a=>{}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement