Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 2.4.1 :005 > x = {a: {foo: 'foo'}}.freeze
- => {:a=>{:foo=>"foo"}}
- 2.4.1 :006 > x.delete(:a)
- RuntimeError: can't modify frozen Hash
- from (irb):6:in `delete'
- from (irb):6
- from /home/greg/.rvm/rubies/ruby-2.4.1/bin/irb:11:in `<main>'
- 2.4.1 :007 > x[:a].delete(:foo)
- => "foo"
- 2.4.1 :008 > x
- => {:a=>{}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement