Class: RubyPushNotifications::GCM::GCMNotification
- Inherits:
-
Object
- Object
- RubyPushNotifications::GCM::GCMNotification
- Defined in:
- lib/ruby-push-notifications/gcm/gcm_notification.rb
Overview
Encapsulates a GCM Notification. By default only Required fields are set. (developer.android.com/google/gcm/server-ref.html#send-downstream)
Instance Attribute Summary collapse
-
#results ⇒ Array
. Array with the results from sending this notification.
Instance Method Summary collapse
-
#as_gcm_json ⇒ String
. The GCM’s JSON format for the payload to send. (developer.android.com/google/gcm/server-ref.html#send-downstream).
-
#initialize(registration_ids, data) ⇒ GCMNotification
constructor
Initializes the notification.
Constructor Details
#initialize(registration_ids, data) ⇒ GCMNotification
Initializes the notification
18 19 20 21 |
# File 'lib/ruby-push-notifications/gcm/gcm_notification.rb', line 18 def initialize(registration_ids, data) @registration_ids = registration_ids @data = data end |
Instance Attribute Details
#results ⇒ Array
Returns . Array with the results from sending this notification.
12 13 14 |
# File 'lib/ruby-push-notifications/gcm/gcm_notification.rb', line 12 def results @results end |
Instance Method Details
#as_gcm_json ⇒ String
Returns . The GCM’s JSON format for the payload to send. (developer.android.com/google/gcm/server-ref.html#send-downstream).
25 26 27 28 29 30 |
# File 'lib/ruby-push-notifications/gcm/gcm_notification.rb', line 25 def as_gcm_json JSON.dump( registration_ids: @registration_ids, data: @data ) end |