Class: JPush::Http::Response
- Inherits:
-
Object
- Object
- JPush::Http::Response
- Defined in:
- lib/jpush/http/response.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#heades ⇒ Object
Returns the value of attribute heades.
-
#http_code ⇒ Object
Returns the value of attribute http_code.
Instance Method Summary collapse
-
#initialize(raw_response) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(raw_response) ⇒ Response
Returns a new instance of Response.
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# 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) unless raw_response.kind_of? Net::HTTPSuccess begin build_error rescue Utils::Exceptions::VIPAppKeyError => e puts "\nVIPAppKeyError: #{e}" puts "\t#{e.backtrace.join("\n\t")}" end end end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
5 6 7 |
# File 'lib/jpush/http/response.rb', line 5 def body @body end |
#heades ⇒ Object
Returns the value of attribute heades.
5 6 7 |
# File 'lib/jpush/http/response.rb', line 5 def heades @heades end |
#http_code ⇒ Object
Returns the value of attribute http_code.
5 6 7 |
# File 'lib/jpush/http/response.rb', line 5 def http_code @http_code end |