Class: Rapns::Daemon::Gcm::Delivery
- Includes:
- MultiJsonHelper
- Defined in:
- lib/rapns/daemon/gcm/delivery.rb
Overview
Constant Summary collapse
- GCM_URI =
URI.parse('https://android.googleapis.com/gcm/send')
- UNAVAILABLE_STATES =
['Unavailable', 'InternalServerError']
Instance Method Summary collapse
-
#initialize(app, http, notification) ⇒ Delivery
constructor
A new instance of Delivery.
- #perform ⇒ Object
Methods included from MultiJsonHelper
#multi_json_dump, #multi_json_load
Methods inherited from Delivery
#mark_delivered, #mark_failed, perform, #retry_after, #retry_exponentially
Methods included from Reflectable
Constructor Details
#initialize(app, http, notification) ⇒ Delivery
Returns a new instance of Delivery.
11 12 13 14 15 |
# File 'lib/rapns/daemon/gcm/delivery.rb', line 11 def initialize(app, http, notification) @app = app @http = http @notification = notification end |
Instance Method Details
#perform ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/rapns/daemon/gcm/delivery.rb', line 17 def perform begin handle_response(do_post) rescue Rapns::DeliveryError => error mark_failed(error.code, error.description) raise end end |