Class: PSClient::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/ps_pop_client/response.rb

Instance Method Summary collapse

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

#parseObject



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_errorObject



15
16
17
# File 'lib/ps_pop_client/response.rb', line 15

def parse_error
   ErrorUtil.parse_response(@response);
end