Class: LeadZeppelin::APNS::ErrorResponse
- Inherits:
-
Object
- Object
- LeadZeppelin::APNS::ErrorResponse
- Defined in:
- lib/lead_zeppelin/apns/error_response.rb
Constant Summary collapse
- CODES =
{ 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', 255 => 'None (unknown)' }
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#notification ⇒ Object
readonly
Returns the value of attribute notification.
Instance Method Summary collapse
-
#initialize(packet, notification = nil) ⇒ ErrorResponse
constructor
A new instance of ErrorResponse.
Constructor Details
#initialize(packet, notification = nil) ⇒ ErrorResponse
Returns a new instance of ErrorResponse.
19 20 21 22 23 |
# File 'lib/lead_zeppelin/apns/error_response.rb', line 19 def initialize(packet, notification=nil) command, @code, @identifier = packet.unpack 'ccA4' @message = CODES[@code] @notification = notification end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
17 18 19 |
# File 'lib/lead_zeppelin/apns/error_response.rb', line 17 def code @code end |
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
17 18 19 |
# File 'lib/lead_zeppelin/apns/error_response.rb', line 17 def identifier @identifier end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
17 18 19 |
# File 'lib/lead_zeppelin/apns/error_response.rb', line 17 def @message end |
#notification ⇒ Object (readonly)
Returns the value of attribute notification.
17 18 19 |
# File 'lib/lead_zeppelin/apns/error_response.rb', line 17 def notification @notification end |