Exception: Pendragon::ResponseError
- Inherits:
-
StandardError
- Object
- StandardError
- Pendragon::ResponseError
show all
- Defined in:
- lib/pendragon/error.rb
Overview
A base class for error responses ResponseError#status and ResponseError#body must be implemented by subclass
Instance Method Summary
collapse
Constructor Details
Returns a new instance of ResponseError.
8
9
10
|
# File 'lib/pendragon/error.rb', line 8
def initialize(*args)
@args = args
end
|
Instance Method Details
#body ⇒ Object
20
21
22
|
# File 'lib/pendragon/error.rb', line 20
def body
raise NotImplementedError, "`body` must be implemented by subclass"
end
|
#call ⇒ Object
12
13
14
|
# File 'lib/pendragon/error.rb', line 12
def call
[status, , Array(body)]
end
|
24
25
26
|
# File 'lib/pendragon/error.rb', line 24
def
||= { "Content-Type" => "text/plain" }
end
|
#status ⇒ Object
16
17
18
|
# File 'lib/pendragon/error.rb', line 16
def status
raise NotImplementedError, "`status` must be implemented by subclass"
end
|