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.



152
153
154
# File 'lib/grifter/http_service.rb', line 152

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

Instance Method Details

#bodyObject



166
167
168
# File 'lib/grifter/http_service.rb', line 166

def body
  @response.body
end

#codeObject

shortcut methods



162
163
164
# File 'lib/grifter/http_service.rb', line 162

def code
  @response.code
end

#to_sObject

this makes good info show up in rspec reports



157
158
159
# File 'lib/grifter/http_service.rb', line 157

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