Skip to content

Instantly share code, notes, and snippets.

@ryanbriones
Created November 24, 2010 18:15
Show Gist options
  • Save ryanbriones/714123 to your computer and use it in GitHub Desktop.
Save ryanbriones/714123 to your computer and use it in GitHub Desktop.
class ChattyHash < Hash
def []=(key, value)
puts "Hash:#{object_id}[#{key}] = #{value}"
super
end
def freeze
puts "Hash:#{object_id} frozen!"
puts caller.inspect
super
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment