Class: JPush::Http::Response

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_response) ⇒ Response

Returns a new instance of Response.



7
8
9
10
11
# File 'lib/jpush/http/response.rb', line 7

def initialize(raw_response)
  @http_code = raw_response.code.to_i
  @body = parse_body(raw_response.body)
  build_error unless raw_response.kind_of? Net::HTTPSuccess
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



5
6
7
# File 'lib/jpush/http/response.rb', line 5

def body
  @body
end

#headesObject

Returns the value of attribute heades.



5
6
7
# File 'lib/jpush/http/response.rb', line 5

def heades
  @heades
end

#http_codeObject

Returns the value of attribute http_code.



5
6
7
# File 'lib/jpush/http/response.rb', line 5

def http_code
  @http_code
end