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
- .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
.send_notification(device_tokens, data = {}, options = {}) ⇒ Object
25 26 27 28 |
# File 'lib/pushmeup/gcm/core.rb', line 25 def self.send_notification(device_tokens, data = {}, = {}) n = GCM::Notification.new(device_tokens, data, ) self.send_notifications([n]) end |
.send_notifications(notifications) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/pushmeup/gcm/core.rb', line 30 def self.send_notifications(notifications) responses = [] notifications.each do |n| responses << self.prepare_and_send(n) end responses end |