Exception: Simple::HTTP::Error
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- Simple::HTTP::Error
show all
- Defined in:
- lib/simple/http/errors.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(response) ⇒ Error
Returns a new instance of Error.
12
13
14
|
# File 'lib/simple/http/errors.rb', line 12
def initialize(response)
@response = response
end
|
Instance Attribute Details
#response ⇒ Object
Returns the value of attribute response.
10
11
12
|
# File 'lib/simple/http/errors.rb', line 10
def response
@response
end
|
Instance Method Details
#message ⇒ Object
28
29
30
|
# File 'lib/simple/http/errors.rb', line 28
def message
"#{verb} #{request.url} ##{status} #{response.message}"
end
|
#request ⇒ Object
20
21
22
|
# File 'lib/simple/http/errors.rb', line 20
def request
@response.request
end
|
#status ⇒ Object
16
17
18
|
# File 'lib/simple/http/errors.rb', line 16
def status
response.status
end
|
#verb ⇒ Object
24
25
26
|
# File 'lib/simple/http/errors.rb', line 24
def verb
request.verb
end
|