Class: Delphix::WebResponse
- Inherits:
-
Object
- Object
- Delphix::WebResponse
- 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.
Constructor Details
#initialize(response) ⇒ WebResponse
Returns a new instance of WebResponse.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/delphix/web_response.rb', line 46 def initialize(response) @code = response.code @headers = response.headers @raw_body = response @body = Hashie::Mash.new(JSON.parse(@raw_body)) = response. Delphix.last_response = { code: response.code, headers: response.headers, body: response.body, cookies: response., description: response.description } end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
36 37 38 |
# File 'lib/delphix/web_response.rb', line 36 def body @body end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
27 28 29 |
# File 'lib/delphix/web_response.rb', line 27 def code @code end |
#cookies ⇒ Object (readonly)
Returns the value of attribute cookies.
44 45 46 |
# File 'lib/delphix/web_response.rb', line 44 def end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
40 41 42 |
# File 'lib/delphix/web_response.rb', line 40 def headers @headers end |
#method ⇒ #raw_body (readonly)
The current session cookies.
31 |
# File 'lib/delphix/web_response.rb', line 31 attr_reader :raw_body |
#raw_body ⇒ Object (readonly)
Returns the value of attribute raw_body.
31 32 33 |
# File 'lib/delphix/web_response.rb', line 31 def raw_body @raw_body end |