Module: GCM
- Includes:
- HTTParty
- Defined in:
- lib/pushmeup/gcm/core.rb,
lib/pushmeup/gcm/notification.rb
Defined Under Namespace
Classes: Notification
Class Attribute Summary collapse
-
.format ⇒ Object
Returns the value of attribute format.
-
.host ⇒ Object
Returns the value of attribute host.
-
.key(identity = nil) ⇒ Object
Returns the value of attribute key.
Class Method Summary collapse
- .key_identities ⇒ Object
- .send_notification(device_tokens, data = {}, options = {}) ⇒ Object
- .send_notifications(notifications) ⇒ Object
Class Attribute Details
.format ⇒ Object
Returns the value of attribute format.
13 14 15 |
# File 'lib/pushmeup/gcm/core.rb', line 13 def format @format end |
.host ⇒ Object
Returns the value of attribute host.
13 14 15 |
# File 'lib/pushmeup/gcm/core.rb', line 13 def host @host end |
.key(identity = nil) ⇒ Object
Returns the value of attribute key.
13 14 15 |
# File 'lib/pushmeup/gcm/core.rb', line 13 def key @key end |
Class Method Details
.key_identities ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/pushmeup/gcm/core.rb', line 24 def key_identities if @key.is_a?(Hash) return @key.keys else return nil end end |
.send_notification(device_tokens, data = {}, options = {}) ⇒ Object
33 34 35 36 |
# File 'lib/pushmeup/gcm/core.rb', line 33 def self.send_notification(device_tokens, data = {}, = {}) n = GCM::Notification.new(device_tokens, data, ) self.send_notifications([n]) end |
.send_notifications(notifications) ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/pushmeup/gcm/core.rb', line 38 def self.send_notifications(notifications) responses = [] notifications.each do |n| responses << self.prepare_and_send(n) end responses end |