Exception: KeyError
- Inherits:
-
IndexError
- Object
- Exception
- StandardError
- IndexError
- KeyError
- Defined in:
- opal/opal/corelib/error.rb,
opal/opal/corelib/error.rb
Instance Method Summary collapse
-
#initialize(message, receiver: nil, key: nil) ⇒ KeyError
constructor
A new instance of KeyError.
- #key ⇒ Object
- #receiver ⇒ Object
Methods inherited from Exception
#backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #inspect, #message, new, #set_backtrace, #to_s
Constructor Details
#initialize(message, receiver: nil, key: nil) ⇒ KeyError
Returns a new instance of KeyError.
304 305 306 307 308 |
# File 'opal/opal/corelib/error.rb', line 304 def initialize(, receiver: nil, key: nil) super() @receiver = receiver @key = key end |
Instance Method Details
#key ⇒ Object
314 315 316 |
# File 'opal/opal/corelib/error.rb', line 314 def key @key || ::Kernel.raise(::ArgumentError, 'no key is available') end |
#receiver ⇒ Object
310 311 312 |
# File 'opal/opal/corelib/error.rb', line 310 def receiver @receiver || ::Kernel.raise(::ArgumentError, 'no receiver is available') end |