Exception: KeyError

Inherits:
IndexError show all
Defined in:
lib/active_support/vendor/i18n-0.3.7/i18n/core_ext/string/interpolate.rb,
lib/active_support/vendor/i18n-0.3.7/i18n/exceptions.rb

Overview

KeyError is raised by String#% when the string contains a named placeholder that is not contained in the given arguments hash. Ruby 1.9 includes and raises this exception natively. We define it to mimic Ruby 1.9’s behaviour in Ruby 1.8.x

Instance Method Summary collapse

Constructor Details

#initialize(message = nil) ⇒ KeyError

Returns a new instance of KeyError.



4
5
6
# File 'lib/active_support/vendor/i18n-0.3.7/i18n/exceptions.rb', line 4

def initialize(message = nil)
  super(message || "key not found")
end