Class: Pushing::NotificationDelivery
- Inherits:
-
Delegator
- Object
- Delegator
- Pushing::NotificationDelivery
- Defined in:
- lib/pushing/notification_delivery.rb
Instance Method Summary collapse
-
#__getobj__ ⇒ Object
:nodoc:.
-
#__setobj__(notification_message) ⇒ Object
Unused except for delegator internals (dup, marshaling).
- #deliver_later!(options = {}) ⇒ Object
- #deliver_now! ⇒ Object
-
#initialize(notifier_class, action, *args) ⇒ NotificationDelivery
constructor
:nodoc:.
- #message ⇒ Object
- #processed? ⇒ Boolean
Constructor Details
#initialize(notifier_class, action, *args) ⇒ NotificationDelivery
:nodoc:
5 6 7 8 9 10 11 12 |
# File 'lib/pushing/notification_delivery.rb', line 5 def initialize(notifier_class, action, *args) #:nodoc: @notifier_class, @action, @args = notifier_class, action, args # The notification is only processed if we try to call any methods on it. # Typical usage will leave it unloaded and call deliver_later. @processed_notifier = nil = nil end |
Instance Method Details
#__getobj__ ⇒ Object
:nodoc:
14 15 16 |
# File 'lib/pushing/notification_delivery.rb', line 14 def __getobj__ #:nodoc: ||= processed_notifier.notification end |
#__setobj__(notification_message) ⇒ Object
Unused except for delegator internals (dup, marshaling).
19 20 21 |
# File 'lib/pushing/notification_delivery.rb', line 19 def __setobj__() #:nodoc: = end |
#deliver_later!(options = {}) ⇒ Object
31 32 33 |
# File 'lib/pushing/notification_delivery.rb', line 31 def deliver_later!( = {}) enqueue_delivery :deliver_now!, end |
#deliver_now! ⇒ Object
35 36 37 |
# File 'lib/pushing/notification_delivery.rb', line 35 def deliver_now! processed_notifier.handle_exceptions { do_deliver } end |
#message ⇒ Object
23 24 25 |
# File 'lib/pushing/notification_delivery.rb', line 23 def __getobj__ end |
#processed? ⇒ Boolean
27 28 29 |
# File 'lib/pushing/notification_delivery.rb', line 27 def processed? @processed_notifier || end |