class RubyPushNotifications::APNS::APNSResults
This class is responsible for holding and managing result of a pushed notification.
@author Carlos Alonso
Attributes
individual_results[R]
@return [Array] of each destination's individual result.
Public Class Methods
new(results)
click to toggle source
Initializes the result
@param [Array] containing each destination's individual result.
# File lib/ruby-push-notifications/apns/apns_results.rb, line 15 def initialize(results) @individual_results = results end
Public Instance Methods
failed()
click to toggle source
@return [Integer] number of failed notifications
# 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()
click to toggle source
@return [Integer] numer of successfully pushed notifications
# File lib/ruby-push-notifications/apns/apns_results.rb, line 20 def success @success ||= individual_results.count { |r| r == NO_ERROR_STATUS_CODE } end