Class: NotifyUser::Gcm
Constant Summary collapse
- PAYLOAD_LIMIT =
4096
Constants inherited from Push
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#push_options ⇒ Object
Returns the value of attribute push_options.
Instance Method Summary collapse
-
#initialize(notifications, devices, options) ⇒ Gcm
constructor
A new instance of Gcm.
- #push ⇒ Object
- #valid?(payload) ⇒ Boolean
Constructor Details
#initialize(notifications, devices, options) ⇒ Gcm
Returns a new instance of Gcm.
9 10 11 12 13 |
# File 'app/models/notify_user/gcm.rb', line 9 def initialize(notifications, devices, ) super(notifications, devices, ) = end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
7 8 9 |
# File 'app/models/notify_user/gcm.rb', line 7 def client @client end |
#push_options ⇒ Object
Returns the value of attribute push_options.
7 8 9 |
# File 'app/models/notify_user/gcm.rb', line 7 def end |
Instance Method Details
#push ⇒ Object
15 16 17 |
# File 'app/models/notify_user/gcm.rb', line 15 def push send_notifications end |
#valid?(payload) ⇒ Boolean
23 24 25 |
# File 'app/models/notify_user/gcm.rb', line 23 def valid?(payload) payload.to_json.bytesize <= PAYLOAD_LIMIT end |