Class: GCM::Service
- Inherits:
-
Object
- Object
- GCM::Service
- Includes:
- ActiveModel::Model
- Defined in:
- lib/mercurius/gcm/service.rb
Constant Summary collapse
- BATCH_SIZE =
999
Instance Attribute Summary collapse
-
#attempts ⇒ Object
readonly
Returns the value of attribute attempts.
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#host ⇒ Object
Returns the value of attribute host.
-
#key ⇒ Object
Returns the value of attribute key.
Instance Method Summary collapse
- #deliver(notification, *tokens, topic: nil) ⇒ Object
-
#initialize ⇒ Service
constructor
A new instance of Service.
Constructor Details
Instance Attribute Details
#attempts ⇒ Object (readonly)
Returns the value of attribute attempts.
8 9 10 |
# File 'lib/mercurius/gcm/service.rb', line 8 def attempts @attempts end |
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
8 9 10 |
# File 'lib/mercurius/gcm/service.rb', line 8 def connection @connection end |
#host ⇒ Object
Returns the value of attribute host.
7 8 9 |
# File 'lib/mercurius/gcm/service.rb', line 7 def host @host end |
#key ⇒ Object
Returns the value of attribute key.
7 8 9 |
# File 'lib/mercurius/gcm/service.rb', line 7 def key @key end |
Instance Method Details
#deliver(notification, *tokens, topic: nil) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/mercurius/gcm/service.rb', line 18 def deliver(notification, *tokens, topic: nil) responses = GCM::ResponseCollection.new(notification) responses << deliver_to_tokens(notification, tokens) responses << deliver_to_topic(notification, topic) if topic responses end |