Class: RubyPushNotifications::MPNS::MPNSResultOK

Inherits:
MPNSResult
  • Object
show all
Defined in:
lib/ruby-push-notifications/mpns/mpns_result.rb

Overview

Indicates that the notification was successfully sent to the corresponding device URL

Constant Summary

Constants inherited from MPNSResult

RubyPushNotifications::MPNS::MPNSResult::X_DEVICE_CONNECTION_STATUS, RubyPushNotifications::MPNS::MPNSResult::X_NOTIFICATION_STATUS, RubyPushNotifications::MPNS::MPNSResult::X_SUBSCRIPTION_STATUS

Instance Attribute Summary collapse

Attributes inherited from MPNSResult

#device_url

Instance Method Summary collapse

Constructor Details

#initialize(device_url, headers) ⇒ MPNSResultOK

Returns a new instance of MPNSResultOK.



35
36
37
38
39
40
# File 'lib/ruby-push-notifications/mpns/mpns_result.rb', line 35

def initialize(device_url, headers)
  @device_url = device_url
  @notification_status = headers[X_NOTIFICATION_STATUS]
  @device_connection_status = headers[X_DEVICE_CONNECTION_STATUS]
  @subscription_status = headers[X_SUBSCRIPTION_STATUS]
end

Instance Attribute Details

#device_connection_statusString

Returns . The connection status of the device.

Returns:

  • (String)

    . The connection status of the device.



30
31
32
# File 'lib/ruby-push-notifications/mpns/mpns_result.rb', line 30

def device_connection_status
  @device_connection_status
end

#notification_statusString

by the Microsoft Push Notification Service.

Returns:

  • (String)

    . The status of the notification received



27
28
29
# File 'lib/ruby-push-notifications/mpns/mpns_result.rb', line 27

def notification_status
  @notification_status
end

#subscription_statusString

Returns . The subscription status.

Returns:

  • (String)

    . The subscription status.



33
34
35
# File 'lib/ruby-push-notifications/mpns/mpns_result.rb', line 33

def subscription_status
  @subscription_status
end

Instance Method Details

#==(other) ⇒ Object



42
43
44
45
46
47
48
# File 'lib/ruby-push-notifications/mpns/mpns_result.rb', line 42

def ==(other)
  (other.is_a?(MPNSResultOK) &&
    device_url == other.device_url &&
    notification_status == other.notification_status &&
    device_connection_status == other.device_connection_status &&
    subscription_status == other.subscription_status) || super(other)
end