Exception: KeyError
- Inherits:
-
IndexError
- Object
- IndexError
- KeyError
- Defined in:
- lib/i18n/string.rb,
lib/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
-
#initialize(message = nil) ⇒ KeyError
constructor
A new instance of KeyError.
Constructor Details
#initialize(message = nil) ⇒ KeyError
Returns a new instance of KeyError.
16 17 18 |
# File 'lib/i18n/string.rb', line 16 def initialize( = nil) super( || "key not found") end |