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.



213
214
215
# File 'lib/grifter/http_service.rb', line 213

def initialize(request, response)
  @request, @response = request, response
end

Instance Method Details

#bodyObject



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

def body
  @response.body
end

#codeObject

shortcut methods



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

def code
  @response.status
end

#to_sObject

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