Class: RubyPushNotifications::APNS::APNSResults
- Inherits:
-
Object
- Object
- RubyPushNotifications::APNS::APNSResults
- Defined in:
- lib/ruby-push-notifications/apns/apns_results.rb
Overview
This class is responsible for holding and managing result of a pushed notification.
Instance Attribute Summary collapse
-
#individual_results ⇒ Array
readonly
Of each destination’s individual result.
Instance Method Summary collapse
-
#failed ⇒ Integer
Number of failed notifications.
-
#initialize(results) ⇒ APNSResults
constructor
Initializes the result.
-
#success ⇒ Integer
Numer of successfully pushed notifications.
Constructor Details
#initialize(results) ⇒ APNSResults
Initializes the result
15 16 17 |
# File 'lib/ruby-push-notifications/apns/apns_results.rb', line 15 def initialize(results) @individual_results = results end |
Instance Attribute Details
#individual_results ⇒ Array (readonly)
Returns of each destination’s individual result.
10 11 12 |
# File 'lib/ruby-push-notifications/apns/apns_results.rb', line 10 def individual_results @individual_results end |
Instance Method Details
#failed ⇒ Integer
Returns number of failed notifications.
25 26 27 |
# File 'lib/ruby-push-notifications/apns/apns_results.rb', line 25 def failed @failed ||= individual_results.count { |r| r != NO_ERROR_STATUS_CODE } end |
#success ⇒ Integer
Returns numer of successfully pushed notifications.
20 21 22 |
# File 'lib/ruby-push-notifications/apns/apns_results.rb', line 20 def success @success ||= individual_results.count { |r| r == NO_ERROR_STATUS_CODE } end |