Exception: Wireless::KeyError
Overview
Raised when an attempt is made to:
- retrieve a value from a key-indexed store when the key doesn't exist
- write a value when the key exists and the store doesn't allow replacements
Can be passed a message, the receiver the lookup failed on, and the key. All are optional and default to nil.
XXX eventually (i.e. in ruby 2.6), this can be a subclass of (or replaced by) the core KeyError class: bugs.ruby-lang.org/issues/14313
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#receiver ⇒ Object
readonly
Returns the value of attribute receiver.
Instance Method Summary collapse
-
#initialize(message = nil, receiver: nil, key: nil) ⇒ KeyError
constructor
A new instance of KeyError.
Constructor Details
#initialize(message = nil, receiver: nil, key: nil) ⇒ KeyError
Returns a new instance of KeyError.
21 22 23 24 25 |
# File 'lib/wireless.rb', line 21 def initialize( = nil, receiver: nil, key: nil) super() @receiver = receiver @key = key end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
27 28 29 |
# File 'lib/wireless.rb', line 27 def key @key end |
#receiver ⇒ Object (readonly)
Returns the value of attribute receiver.
27 28 29 |
# File 'lib/wireless.rb', line 27 def receiver @receiver end |