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



123
124
125
# File 'lib/grifter/http_service.rb', line 123

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

Instance Method Details

#bodyObject



137
138
139
# File 'lib/grifter/http_service.rb', line 137

def body
  @response.body
end

#codeObject

shortcut methods



133
134
135
# File 'lib/grifter/http_service.rb', line 133

def code
  @response.code
end

#to_sObject

this makes good info show up in rspec reports



128
129
130
# File 'lib/grifter/http_service.rb', line 128

def to_s
  "#{self.class}\nResponseCode: #{@response.code}\nResponseBody:\n#{@response.body}"
end