Class: RubyPushNotifications::WNS::WNSInvalidError

Inherits:
WNSResult
  • Object
show all
Defined in:
lib/ruby-push-notifications/wns/wns_result.rb

Overview

Notification is invalid and is not present on the Push Notification Service.

Constant Summary

Constants inherited from WNSResult

RubyPushNotifications::WNS::WNSResult::X_DEVICE_CONNECTION_STATUS, RubyPushNotifications::WNS::WNSResult::X_NOTIFICATION_STATUS, RubyPushNotifications::WNS::WNSResult::X_STATUS

Instance Attribute Summary collapse

Attributes inherited from WNSResult

#device_url

Instance Method Summary collapse

Constructor Details

#initialize(device_url, headers) ⇒ WNSInvalidError

Returns a new instance of WNSInvalidError.



86
87
88
89
90
91
# File 'lib/ruby-push-notifications/wns/wns_result.rb', line 86

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

Instance Attribute Details

#device_connection_statusString

Returns . The connection status of the device.

Returns:

  • (String)

    . The connection status of the device.



81
82
83
# File 'lib/ruby-push-notifications/wns/wns_result.rb', line 81

def device_connection_status
  @device_connection_status
end

#notification_statusString

by the Windows Notification Service.

Returns:

  • (String)

    . The status of the notification received



78
79
80
# File 'lib/ruby-push-notifications/wns/wns_result.rb', line 78

def notification_status
  @notification_status
end

#statusString

Returns . Notification status.

Returns:

  • (String)

    . Notification status.



84
85
86
# File 'lib/ruby-push-notifications/wns/wns_result.rb', line 84

def status
  @status
end

Instance Method Details

#==(other) ⇒ Object



93
94
95
96
97
98
99
# File 'lib/ruby-push-notifications/wns/wns_result.rb', line 93

def ==(other)
  (other.is_a?(WNSInvalidError) &&
    device_url == other.device_url &&
    notification_status == other.notification_status &&
    device_connection_status == other.device_connection_status &&
    status == other.status) || super(other)
end