Class: Whiskey::Server::Error
- Inherits:
-
Object
- Object
- Whiskey::Server::Error
- Defined in:
- lib/whiskey/server/error.rb
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(code) ⇒ Error
constructor
A new instance of Error.
- #message ⇒ Object
- #status ⇒ Object
- #title ⇒ Object
- #to_hash ⇒ Object
- #to_s ⇒ Object
Constructor Details
Instance Method Details
#body ⇒ Object
28 29 30 |
# File 'lib/whiskey/server/error.rb', line 28 def body @payload[:body] end |
#message ⇒ Object
16 17 18 |
# File 'lib/whiskey/server/error.rb', line 16 def "#{title} - #{body}" end |
#status ⇒ Object
20 21 22 |
# File 'lib/whiskey/server/error.rb', line 20 def status @payload[:status] end |
#title ⇒ Object
24 25 26 |
# File 'lib/whiskey/server/error.rb', line 24 def title @payload[:title] end |
#to_hash ⇒ Object
9 10 11 12 13 14 |
# File 'lib/whiskey/server/error.rb', line 9 def to_hash { status: status, error: } end |
#to_s ⇒ Object
32 33 34 |
# File 'lib/whiskey/server/error.rb', line 32 def to_s "#{status} #{}" end |