Class: Poke::API::Response
- Inherits:
-
Object
- Object
- Poke::API::Response
- Includes:
- Logging
- Defined in:
- lib/poke-api/response.rb
Instance Attribute Summary collapse
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #decode(client) ⇒ Object
-
#initialize(response, request) ⇒ Response
constructor
A new instance of Response.
Methods included from Logging
formatter=, log_level=, #logger
Constructor Details
#initialize(response, request) ⇒ Response
Returns a new instance of Response.
7 8 9 10 |
# File 'lib/poke-api/response.rb', line 7 def initialize(response, request) @response = response @request = request end |
Instance Attribute Details
#request ⇒ Object (readonly)
Returns the value of attribute request.
5 6 7 |
# File 'lib/poke-api/response.rb', line 5 def request @request end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
5 6 7 |
# File 'lib/poke-api/response.rb', line 5 def response @response end |
Instance Method Details
#decode(client) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/poke-api/response.rb', line 12 def decode(client) logger.info '[+] Decoding Main RPC responses' logger.debug "[+] RPC response \r\n#{@response.inspect}" @response = POGOProtos::Networking::Envelopes::ResponseEnvelope.decode(@response) logger.debug "[+] Decoded RPC response \r\n#{@response.inspect}" store_ticket(client) store_endpoint(client) decode_response end |