Class: ApnMachine::Server::ErrorResponse
- Inherits:
-
Object
- Object
- ApnMachine::Server::ErrorResponse
- Defined in:
- lib/apnmachine/server/error_response.rb
Constant Summary collapse
- DESCRIPTION =
{ 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
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize(command, status_code, identifier) ⇒ ErrorResponse
constructor
A new instance of ErrorResponse.
- #to_s ⇒ Object
Constructor Details
#initialize(command, status_code, identifier) ⇒ ErrorResponse
Returns a new instance of ErrorResponse.
20 21 22 23 24 |
# File 'lib/apnmachine/server/error_response.rb', line 20 def initialize(command, status_code, identifier) @command = command @status_code = status_code @identifier = identifier end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
18 19 20 |
# File 'lib/apnmachine/server/error_response.rb', line 18 def command @command end |
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
18 19 20 |
# File 'lib/apnmachine/server/error_response.rb', line 18 def identifier @identifier end |
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
18 19 20 |
# File 'lib/apnmachine/server/error_response.rb', line 18 def status_code @status_code end |
Instance Method Details
#description ⇒ Object
30 31 32 |
# File 'lib/apnmachine/server/error_response.rb', line 30 def description DESCRIPTION[@status_code] || "Missing description" end |
#to_s ⇒ Object
26 27 28 |
# File 'lib/apnmachine/server/error_response.rb', line 26 def to_s "CODE=#{@status_code} ID=#{@identifier} DESC=#{description}" end |