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.
212 213 214 |
# File 'lib/grifter/http_service.rb', line 212 def initialize(request, response) @request, @response = request, response end |
Instance Method Details
#body ⇒ Object
226 227 228 |
# File 'lib/grifter/http_service.rb', line 226 def body @response.body end |
#code ⇒ Object
shortcut methods
222 223 224 |
# File 'lib/grifter/http_service.rb', line 222 def code @response.status end |
#to_s ⇒ Object
this makes good info show up in rspec reports
217 218 219 |
# File 'lib/grifter/http_service.rb', line 217 def to_s "#{self.class}\nResponseCode: #{self.code}\nResponseBody:\n#{self.body}" end |