Exception: Grifter::RequestException
- Defined in:
- lib/grifter/http_service.rb
Instance Method Summary collapse
- #body ⇒ Object
-
#code ⇒ Object
shortcut methods.
-
#initialize(request, response) ⇒ RequestException
constructor
A new instance of RequestException.
-
#to_s ⇒ Object
this makes good info show up in rspec reports.
Constructor Details
#initialize(request, response) ⇒ RequestException
Returns a new instance of RequestException.
213 214 215 |
# File 'lib/grifter/http_service.rb', line 213 def initialize(request, response) @request, @response = request, response end |
Instance Method Details
#body ⇒ Object
227 228 229 |
# File 'lib/grifter/http_service.rb', line 227 def body @response.body end |
#code ⇒ Object
shortcut methods
223 224 225 |
# File 'lib/grifter/http_service.rb', line 223 def code @response.status end |
#to_s ⇒ Object
this makes good info show up in rspec reports
218 219 220 |
# File 'lib/grifter/http_service.rb', line 218 def to_s "#{self.class}\nResponseCode: #{self.code}\nResponseBody:\n#{self.body}" end |