Class: RubyPushNotifications::WNS::WNSExpiredError

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

Overview

The device is in a disconnected state.

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) ⇒ WNSExpiredError

Returns a new instance of WNSExpiredError.



168
169
170
171
172
173
# File 'lib/ruby-push-notifications/wns/wns_result.rb', line 168

def initialize(device_url, headers)
  @device_url = device_url
  @notification_status = headers[X_NOTIFICATION_STATUS]
  @device_connection_status = headers[X_DEVICE_CONNECTION_STATUS]
  @status = 'Expired'.freeze
end

Instance Attribute Details

#device_connection_statusString

Returns . The connection status of the device.

Returns:

  • (String)

    . The connection status of the device.



163
164
165
# File 'lib/ruby-push-notifications/wns/wns_result.rb', line 163

def device_connection_status
  @device_connection_status
end

#notification_statusString

by the Windows Notification Service.

Returns:

  • (String)

    . The status of the notification received



160
161
162
# File 'lib/ruby-push-notifications/wns/wns_result.rb', line 160

def notification_status
  @notification_status
end

#statusString

Returns . Notification status.

Returns:

  • (String)

    . Notification status.



166
167
168
# File 'lib/ruby-push-notifications/wns/wns_result.rb', line 166

def status
  @status
end

Instance Method Details

#==(other) ⇒ Object



175
176
177
178
179
180
181
# File 'lib/ruby-push-notifications/wns/wns_result.rb', line 175

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