Class: Delphix::WebResponse
- Inherits:
-
Object
- Object
- Delphix::WebResponse
- Includes:
- Utils, Net::HTTPHeader
- Defined in:
- lib/delphix/web_response.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#cookies ⇒ Object
readonly
Returns the value of attribute cookies.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#method ⇒ #raw_body
readonly
The current session cookies.
-
#raw_body ⇒ Object
readonly
Returns the value of attribute raw_body.
Instance Method Summary collapse
-
#initialize(response) ⇒ WebResponse
constructor
A new instance of WebResponse.
Methods included from Utils
Constructor Details
#initialize(response) ⇒ WebResponse
Returns a new instance of WebResponse.
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/delphix/web_response.rb', line 50 def initialize(response) @code = response.code @headers = response.headers @raw_body = response @body = @raw_body @cookies = response. Delphix.last_response = { code: response.code, headers: response.headers, body: JSON.parse(response.body), cookies: response., description: response.description }.recursively_normalize_keys begin @body = JSON.parse(@raw_body) rescue Exception end end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
40 41 42 |
# File 'lib/delphix/web_response.rb', line 40 def body @body end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
31 32 33 |
# File 'lib/delphix/web_response.rb', line 31 def code @code end |
#cookies ⇒ Object (readonly)
Returns the value of attribute cookies.
48 49 50 |
# File 'lib/delphix/web_response.rb', line 48 def @cookies end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
44 45 46 |
# File 'lib/delphix/web_response.rb', line 44 def headers @headers end |
#method ⇒ #raw_body (readonly)
The current session cookies.
35 |
# File 'lib/delphix/web_response.rb', line 35 attr_reader :raw_body |
#raw_body ⇒ Object (readonly)
Returns the value of attribute raw_body.
35 36 37 |
# File 'lib/delphix/web_response.rb', line 35 def raw_body @raw_body end |