Class: RubyPushNotifications::WNS::WNSResponse
- Inherits:
-
Object
- Object
- RubyPushNotifications::WNS::WNSResponse
- Defined in:
- lib/ruby-push-notifications/wns/wns_response.rb
Overview
This class encapsulates a response received from the WNS 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 WNSResult 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) ⇒ WNSResponse
constructor
Initializes the WNSResponse and runs response parsing.
Constructor Details
#initialize(responses) ⇒ WNSResponse
Initializes the WNSResponse and runs response parsing
23 24 25 |
# File 'lib/ruby-push-notifications/wns/wns_response.rb', line 23 def initialize(responses) parse_response responses end |
Instance Attribute Details
#failed ⇒ Integer (readonly)
Returns the number of failed notifications.
13 14 15 |
# File 'lib/ruby-push-notifications/wns/wns_response.rb', line 13 def failed @failed end |
#results ⇒ Array (readonly) Also known as: individual_results
Returns Array of a WNSResult for every receiver of the notification sent indicating the result of the operation.
17 18 19 |
# File 'lib/ruby-push-notifications/wns/wns_response.rb', line 17 def results @results end |
#success ⇒ Integer (readonly)
Returns the number of successfully sent notifications.
10 11 12 |
# File 'lib/ruby-push-notifications/wns/wns_response.rb', line 10 def success @success end |
Instance Method Details
#==(other) ⇒ Object
27 28 29 30 31 32 |
# File 'lib/ruby-push-notifications/wns/wns_response.rb', line 27 def ==(other) (other.is_a?(WNSResponse) && success == other.success && failed == other.failed && results == other.results) || super(other) end |