Class: Datomic::Client::Response
- Inherits:
-
Object
- Object
- Datomic::Client::Response
- Defined in:
- lib/datomic/client/response.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Args used to make request.
-
#body ⇒ Object
readonly
Response body as a string.
-
#net_http ⇒ Object
readonly
Underlying Net:HTTP response.
Instance Method Summary collapse
-
#data ⇒ Object
converts an EDN body to a data structure i.e.
-
#initialize(body, response, request) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(body, response, request) ⇒ Response
Returns a new instance of Response.
11 12 13 14 15 16 17 |
# File 'lib/datomic/client/response.rb', line 11 def initialize(body, response, request) @body = body @args = request.args @net_http = response # used to parse response cookies and headers @rest_client_response = RestClient::Response.create(body, response, @args) end |
Instance Attribute Details
#args ⇒ Object (readonly)
Args used to make request
9 10 11 |
# File 'lib/datomic/client/response.rb', line 9 def args @args end |
#body ⇒ Object (readonly)
Response body as a string
5 6 7 |
# File 'lib/datomic/client/response.rb', line 5 def body @body end |
#net_http ⇒ Object (readonly)
Underlying Net:HTTP response
7 8 9 |
# File 'lib/datomic/client/response.rb', line 7 def net_http @net_http end |
Instance Method Details
#data ⇒ Object
converts an EDN body to a data structure i.e. array, hash
20 21 22 |
# File 'lib/datomic/client/response.rb', line 20 def data @data ||= EDN.read @body end |