Class: GCM::Notification

Inherits:
Object
  • Object
show all
Defined in:
lib/pushmeup/gcm/notification.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tokens, data, options = {}) ⇒ Notification

Returns a new instance of Notification.



5
6
7
8
9
10
11
12
13
# File 'lib/pushmeup/gcm/notification.rb', line 5

def initialize(tokens, data, options = {})
  self.device_tokens = tokens
  self.data = data

  @collapse_key = options[:collapse_key]
  @time_to_live = options[:time_to_live]
  @delay_while_idle = options[:delay_while_idle]
  @identity = options[:identity]
end

Instance Attribute Details

#collapse_keyObject

Returns the value of attribute collapse_key.



3
4
5
# File 'lib/pushmeup/gcm/notification.rb', line 3

def collapse_key
  @collapse_key
end

#dataObject

Returns the value of attribute data.



3
4
5
# File 'lib/pushmeup/gcm/notification.rb', line 3

def data
  @data
end

#delay_while_idleObject

Returns the value of attribute delay_while_idle.



3
4
5
# File 'lib/pushmeup/gcm/notification.rb', line 3

def delay_while_idle
  @delay_while_idle
end

#device_tokensObject

Returns the value of attribute device_tokens.



3
4
5
# File 'lib/pushmeup/gcm/notification.rb', line 3

def device_tokens
  @device_tokens
end

#identityObject

Returns the value of attribute identity.



3
4
5
# File 'lib/pushmeup/gcm/notification.rb', line 3

def identity
  @identity
end

#time_to_liveObject

Returns the value of attribute time_to_live.



3
4
5
# File 'lib/pushmeup/gcm/notification.rb', line 3

def time_to_live
  @time_to_live
end

Instance Method Details

#==(that) ⇒ Object



45
46
47
48
49
50
51
52
# File 'lib/pushmeup/gcm/notification.rb', line 45

def ==(that)
  device_tokens == that.device_tokens &&
  data == that.data &&
  collapse_key == that.collapse_key &&
  time_to_live == that.time_to_live &&
  delay_while_idle == that.delay_while_idle &&
  identity == that.identity
end