Exception: SaasRunner::ResponseError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/saas_runner/response_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response = nil) ⇒ ResponseError

Returns a new instance of ResponseError.



5
6
7
8
9
10
11
12
13
14
# File 'lib/saas_runner/response_error.rb', line 5

def initialize(response = nil)
  @response = response

  @body = response[:body]
  @status = response[:status].to_i
  @method = response[:method].to_s.upcase
  @url = response[:url]

  super
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



3
4
5
# File 'lib/saas_runner/response_error.rb', line 3

def body
  @body
end

#methodObject (readonly)

Returns the value of attribute method.



3
4
5
# File 'lib/saas_runner/response_error.rb', line 3

def method
  @method
end

#responseObject (readonly)

Returns the value of attribute response.



3
4
5
# File 'lib/saas_runner/response_error.rb', line 3

def response
  @response
end

#statusObject (readonly)

Returns the value of attribute status.



3
4
5
# File 'lib/saas_runner/response_error.rb', line 3

def status
  @status
end

#urlObject (readonly)

Returns the value of attribute url.



3
4
5
# File 'lib/saas_runner/response_error.rb', line 3

def url
  @url
end

Instance Method Details

#to_sObject



16
17
18
# File 'lib/saas_runner/response_error.rb', line 16

def to_s
  "#{status} #{method} #{url} | Errors: #{errors}"
end