Exception: Wurk::API::Validation::Invalid
- Inherits:
-
StandardError
- Object
- StandardError
- Wurk::API::Validation::Invalid
- Defined in:
- lib/wurk/api/validation.rb
Overview
Carries the problem it should be rendered as, so a route rescues one class and renders whatever it was handed instead of mapping message text back onto a status code.
Instance Attribute Summary collapse
-
#extra ⇒ Object
readonly
Returns the value of attribute extra.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(detail, type: Problem::INVALID_REQUEST, status: 400, **extra) ⇒ Invalid
constructor
A new instance of Invalid.
Constructor Details
#initialize(detail, type: Problem::INVALID_REQUEST, status: 400, **extra) ⇒ Invalid
Returns a new instance of Invalid.
29 30 31 32 33 34 |
# File 'lib/wurk/api/validation.rb', line 29 def initialize(detail, type: Problem::INVALID_REQUEST, status: 400, **extra) super(detail) @type = type @status = status @extra = extra end |
Instance Attribute Details
#extra ⇒ Object (readonly)
Returns the value of attribute extra.
27 28 29 |
# File 'lib/wurk/api/validation.rb', line 27 def extra @extra end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
27 28 29 |
# File 'lib/wurk/api/validation.rb', line 27 def status @status end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
27 28 29 |
# File 'lib/wurk/api/validation.rb', line 27 def type @type end |