Exception: SpookAndPay::MissingValueError
- Inherits:
-
StandardError
- Object
- StandardError
- SpookAndPay::MissingValueError
- Defined in:
- lib/spook_and_pay/missing_value_error.rb
Overview
A simple error class used to capture situations where the user is attampting to access a value, but it is not available. This is unfortunately necessary due to the way some providers do or do not return certain fields. Rather than allow comparison with nil values we throw this error.
Instance Method Summary collapse
-
#initialize(field, record) ⇒ MissingValueError
constructor
When instancing this error, it needs to have enough information to point the user to the source.
-
#to_s ⇒ Object
Human readable error message.
Constructor Details
#initialize(field, record) ⇒ MissingValueError
When instancing this error, it needs to have enough information to point the user to the source.
13 14 15 16 |
# File 'lib/spook_and_pay/missing_value_error.rb', line 13 def initialize(field, record) @field = field @record = record end |
Instance Method Details
#to_s ⇒ Object
Human readable error message.
21 22 23 |
# File 'lib/spook_and_pay/missing_value_error.rb', line 21 def to_s "The field #{@field} is missing for #{@record.class}" end |