Exception: Krack::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Krack::Error
- Defined in:
- lib/krack/error.rb
Instance Attribute Summary collapse
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(status = 500) ⇒ Error
constructor
A new instance of Error.
- #respond ⇒ Object
Constructor Details
#initialize(status = 500) ⇒ Error
Returns a new instance of Error.
6 7 8 |
# File 'lib/krack/error.rb', line 6 def initialize(status=500) @status = status end |
Instance Attribute Details
#status ⇒ Object
Returns the value of attribute status.
4 5 6 |
# File 'lib/krack/error.rb', line 4 def status @status end |
Instance Method Details
#respond ⇒ Object
10 11 12 |
# File 'lib/krack/error.rb', line 10 def respond {error: {status: status, message: Rack::Utils::HTTP_STATUS_CODES[status]}} end |