Exception: Grifter::RequestException

Inherits:
Exception
  • Object
show all
Defined in:
lib/grifter/http_service.rb

Instance Method Summary collapse

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

#bodyObject



226
227
228
# File 'lib/grifter/http_service.rb', line 226

def body
  @response.body
end

#codeObject

shortcut methods



222
223
224
# File 'lib/grifter/http_service.rb', line 222

def code
  @response.status
end

#to_sObject

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