Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/verbose_hash_fetch.rb

Instance Method Summary collapse

Instance Method Details

#_fetchObject



15
# File 'lib/verbose_hash_fetch.rb', line 15

alias_method :_fetch, :fetch

#fetch(*args, &block) ⇒ Object



17
18
19
20
21
22
# File 'lib/verbose_hash_fetch.rb', line 17

def fetch(*args, &block)
  _fetch(*args, &block)
rescue KeyError => key_error
  key_error._original_hash = self
  raise
end