Exception: Blodsband::Error
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- Blodsband::Error
- Defined in:
- lib/blodsband/error.rb
Overview
A class that collects a single HTTP based error.
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(http) ⇒ Error
constructor
A new instance of Error.
- #to_s ⇒ Object
Constructor Details
#initialize(http) ⇒ Error
Returns a new instance of Error.
9 10 11 12 |
# File 'lib/blodsband/error.rb', line 9 def initialize(http) @status = http.response_header.status @response = http.response end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
8 9 10 |
# File 'lib/blodsband/error.rb', line 8 def response @response end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
8 9 10 |
# File 'lib/blodsband/error.rb', line 8 def status @status end |
Instance Method Details
#to_s ⇒ Object
13 14 15 |
# File 'lib/blodsband/error.rb', line 13 def to_s "#{@response}: #{@status}" end |