Exception: Rpush::DeliveryError
- Inherits:
-
StandardError
- Object
- StandardError
- Rpush::DeliveryError
- Defined in:
- lib/rpush/daemon/delivery_error.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#notification_id ⇒ Object
readonly
Returns the value of attribute notification_id.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(code, notification_id, description) ⇒ DeliveryError
constructor
A new instance of DeliveryError.
- #message ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(code, notification_id, description) ⇒ DeliveryError
Returns a new instance of DeliveryError.
5 6 7 8 9 |
# File 'lib/rpush/daemon/delivery_error.rb', line 5 def initialize(code, notification_id, description) @code = code @notification_id = notification_id @description = description end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
3 4 5 |
# File 'lib/rpush/daemon/delivery_error.rb', line 3 def code @code end |
#notification_id ⇒ Object (readonly)
Returns the value of attribute notification_id.
3 4 5 |
# File 'lib/rpush/daemon/delivery_error.rb', line 3 def notification_id @notification_id end |
Instance Method Details
#==(other) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/rpush/daemon/delivery_error.rb', line 20 def ==(other) other.is_a?(DeliveryError) && \ other.code == code && \ other.notification_id == notification_id && \ other.to_s == to_s end |
#message ⇒ Object
15 16 17 18 |
# File 'lib/rpush/daemon/delivery_error.rb', line 15 def error_str = [@code, "(#{@description})"].compact.join(' ') "Unable to deliver notification #{@notification_id}, received error #{error_str}" end |
#to_s ⇒ Object
11 12 13 |
# File 'lib/rpush/daemon/delivery_error.rb', line 11 def to_s end |