Class: PSClient::Response
- Inherits:
-
Object
- Object
- PSClient::Response
- Defined in:
- lib/ps_pop_client/response.rb
Instance Method Summary collapse
-
#initialize(response = {}) ⇒ Response
constructor
A new instance of Response.
- #parse ⇒ Object
- #parse_error ⇒ Object
Constructor Details
#initialize(response = {}) ⇒ Response
Returns a new instance of Response.
6 7 8 |
# File 'lib/ps_pop_client/response.rb', line 6 def initialize(response= {}) @response=response end |
Instance Method Details
#parse ⇒ Object
10 11 12 13 |
# File 'lib/ps_pop_client/response.rb', line 10 def parse res_body = JSON.parse(@response.body) { status: @response.code.to_i , data:res_body["data"]} end |
#parse_error ⇒ Object
15 16 17 |
# File 'lib/ps_pop_client/response.rb', line 15 def parse_error ErrorUtil.parse_response(@response); end |