Class: AppleShove::APNS::ErrorResponsePacket
- Inherits:
-
Object
- Object
- AppleShove::APNS::ErrorResponsePacket
- Defined in:
- lib/apple_shove/apns/error_response_packet.rb
Constant Summary collapse
- STATUS_MESSAGES =
{ 0 => 'No errors encountered', 1 => 'Processing error', 2 => 'Missing device token', 3 => 'Missing topic', 4 => 'Missing payload', 5 => 'Invalid token size', 6 => 'Invalid topic size', 7 => 'Invalid payload size', 8 => 'Invalid token', 10 => 'Shotdown', 255 => 'None (unknown)' }
Instance Attribute Summary collapse
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(binary_response) ⇒ ErrorResponsePacket
constructor
A new instance of ErrorResponsePacket.
- #status_message ⇒ Object
Constructor Details
#initialize(binary_response) ⇒ ErrorResponsePacket
Returns a new instance of ErrorResponsePacket.
19 20 21 22 23 24 |
# File 'lib/apple_shove/apns/error_response_packet.rb', line 19 def initialize(binary_response) response = binary_response.unpack('CCA4') @status = response[1] @identifier = response[2] end |
Instance Attribute Details
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
5 6 7 |
# File 'lib/apple_shove/apns/error_response_packet.rb', line 5 def identifier @identifier end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
5 6 7 |
# File 'lib/apple_shove/apns/error_response_packet.rb', line 5 def status @status end |
Instance Method Details
#status_message ⇒ Object
26 27 28 |
# File 'lib/apple_shove/apns/error_response_packet.rb', line 26 def STATUS_MESSAGES[@status] end |