Class: ThecoreBackendCommons::PushNotificationService
- Inherits:
-
Object
- Object
- ThecoreBackendCommons::PushNotificationService
- Defined in:
- lib/thecore_backend_commons/push_notification_service.rb
Constant Summary collapse
- MAX_MESSAGES_DEFAULT =
500
Class Method Summary collapse
Instance Method Summary collapse
- #dispatch ⇒ Object
-
#initialize(subscriber, message) ⇒ PushNotificationService
constructor
A new instance of PushNotificationService.
Constructor Details
#initialize(subscriber, message) ⇒ PushNotificationService
Returns a new instance of PushNotificationService.
9 10 11 12 |
# File 'lib/thecore_backend_commons/push_notification_service.rb', line 9 def initialize(subscriber, ) @subscriber = subscriber @message = end |
Class Method Details
.dispatch(subscriber, message) ⇒ Object
5 6 7 |
# File 'lib/thecore_backend_commons/push_notification_service.rb', line 5 def self.dispatch(subscriber, ) new(subscriber, ).dispatch end |
Instance Method Details
#dispatch ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/thecore_backend_commons/push_notification_service.rb', line 14 def dispatch send_push @message rescue => e Rails.logger.error("[PushNotificationService] dispatch failed: #{e.}") @message end |