Class: Testrail::Response

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/testrail/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(http_response = nil) ⇒ Response

Returns a new instance of Response.



13
14
15
16
17
# File 'lib/testrail/response.rb', line 13

def initialize(http_response = nil)
  @http_response = http_response
  parse_payload if http_response.respond_to?(:body) && !http_response.body.nil?
  parse_error if Integer(http_response.code) >= 400
end

Instance Attribute Details

#errorObject

Returns the value of attribute error.



7
8
9
# File 'lib/testrail/response.rb', line 7

def error
  @error
end

#http_responseObject (readonly)

Returns the value of attribute http_response.



6
7
8
# File 'lib/testrail/response.rb', line 6

def http_response
  @http_response
end

#payloadObject

Returns the value of attribute payload.



7
8
9
# File 'lib/testrail/response.rb', line 7

def payload
  @payload
end

#successObject

Returns the value of attribute success.



7
8
9
# File 'lib/testrail/response.rb', line 7

def success
  @success
end