Exception: Simple::HTTP::Error
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- Simple::HTTP::Error
- Defined in:
- lib/simple/http/errors.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(response) ⇒ Error
constructor
A new instance of Error.
- #message ⇒ Object
- #request ⇒ Object
- #status ⇒ Object
- #verb ⇒ Object
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 (readonly)
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 "#{verb} #{request.uri} ##{status} #{response.}" 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.class::METHOD end |