Exception: Obscured::Doorman::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Obscured::Doorman::Error
- Defined in:
- lib/obscured-doorman/errors.rb
Constant Summary collapse
- ERRORS =
{ invalid_api_method: 'No method parameter was supplied', unspecified_error: 'Unspecified error', already_exists: '{what}', does_not_exist: '{what}', does_not_match: '{what}', account: '{what}', invalid_date: 'Cannot parse {what} from: {date}', invalid_type: '{what}', not_active: 'Not active', required_field_missing: 'Required field {field} is missing' }.freeze
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#field ⇒ Object
readonly
Returns the value of attribute field.
Instance Method Summary collapse
-
#initialize(code, params = {}) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(code, params = {}) ⇒ Error
Returns a new instance of Error.
23 24 25 26 27 28 29 30 31 |
# File 'lib/obscured-doorman/errors.rb', line 23 def initialize(code, params = {}) field = params.delete(:field) error = params.delete(:error) super(parse(code, params)) @code = code || :unspecified_error @field = field || :unspecified_field @error = error end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
6 7 8 |
# File 'lib/obscured-doorman/errors.rb', line 6 def code @code end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
8 9 10 |
# File 'lib/obscured-doorman/errors.rb', line 8 def error @error end |
#field ⇒ Object (readonly)
Returns the value of attribute field.
7 8 9 |
# File 'lib/obscured-doorman/errors.rb', line 7 def field @field end |