Class: RubyPushNotifications::GCM::GCMCanonicalIDResult

Inherits:
GCMResult
  • Object
show all
Defined in:
lib/ruby-push-notifications/gcm/gcm_result.rb

Overview

Indicates that the notification was successfully sent to the corresponding registration ID but GCM sent a canonical ID for it, so the received canonical ID should be used as registration ID ASAP.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(canonical_id) ⇒ GCMCanonicalIDResult

Returns a new instance of GCMCanonicalIDResult.



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

def initialize(canonical_id)
  @canonical_id = canonical_id
end

Instance Attribute Details

#canonical_idString (readonly)

Returns . The suggested canonical ID from GCM.

Returns:

  • (String)

    . The suggested canonical ID from GCM



25
26
27
# File 'lib/ruby-push-notifications/gcm/gcm_result.rb', line 25

def canonical_id
  @canonical_id
end

Instance Method Details

#==(other) ⇒ Object



31
32
33
34
# File 'lib/ruby-push-notifications/gcm/gcm_result.rb', line 31

def ==(other)
  (other.is_a?(GCMCanonicalIDResult) && @canonical_id == other.canonical_id) ||
  super(other)
end