Exception: KeyError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#hashObject

Returns the value of attribute hash.



2
3
4
# File 'lib/verbose_hash_fetch.rb', line 2

def hash
  @hash
end

Instance Method Details

#to_sObject



4
5
6
7
8
9
10
# File 'lib/verbose_hash_fetch.rb', line 4

def to_s
  if hash
    "#{super} in #{hash.class}: #{hash.inspect}"
  else
    super
  end
end