Class: RubyPushNotifications::MPNS::MPNSResponse
- Inherits:
-
Object
- Object
- RubyPushNotifications::MPNS::MPNSResponse
- Defined in:
- lib/ruby-push-notifications/mpns/mpns_response.rb
Overview
This class encapsulates a response received from the MPNS service and helps parsing and understanding the received messages/codes.
Instance Attribute Summary collapse
-
#failed ⇒ Integer
readonly
The number of failed notifications.
-
#results ⇒ Array
(also: #individual_results)
readonly
Array of a MPNSResult for every receiver of the notification sent indicating the result of the operation.
-
#success ⇒ Integer
readonly
The number of successfully sent notifications.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(responses) ⇒ MPNSResponse
constructor
Initializes the MPNSResponse and runs response parsing.
Constructor Details
#initialize(responses) ⇒ MPNSResponse
Initializes the MPNSResponse and runs response parsing
24 25 26 |
# File 'lib/ruby-push-notifications/mpns/mpns_response.rb', line 24 def initialize(responses) parse_response responses end |
Instance Attribute Details
#failed ⇒ Integer (readonly)
Returns the number of failed notifications.
14 15 16 |
# File 'lib/ruby-push-notifications/mpns/mpns_response.rb', line 14 def failed @failed end |
#results ⇒ Array (readonly) Also known as: individual_results
Returns Array of a MPNSResult for every receiver of the notification sent indicating the result of the operation.
18 19 20 |
# File 'lib/ruby-push-notifications/mpns/mpns_response.rb', line 18 def results @results end |
#success ⇒ Integer (readonly)
Returns the number of successfully sent notifications.
11 12 13 |
# File 'lib/ruby-push-notifications/mpns/mpns_response.rb', line 11 def success @success end |
Instance Method Details
#==(other) ⇒ Object
28 29 30 31 32 33 |
# File 'lib/ruby-push-notifications/mpns/mpns_response.rb', line 28 def ==(other) (other.is_a?(MPNSResponse) && success == other.success && failed == other.failed && results == other.results) || super(other) end |