Module: Tolliver::Models::Notification
- Extended by:
- ActiveSupport::Concern
- Included in:
- Notification
- Defined in:
- lib/tolliver/models/notification.rb
Instance Method Summary collapse
-
#deliver ⇒ Object
*********************************************************************** Service ***********************************************************************.
-
#done ⇒ Object
*********************************************************************** Progress ***********************************************************************.
- #enqueue_for_delivery ⇒ Object
- #reset_delivery ⇒ Object
Instance Method Details
#deliver ⇒ Object
*********************************************************************** Service ***********************************************************************
48 49 50 |
# File 'lib/tolliver/models/notification.rb', line 48 def deliver Tolliver::Services::DeliveryService.instance.deliver(self) end |
#done ⇒ Object
*********************************************************************** Progress ***********************************************************************
34 35 36 37 38 39 40 41 42 |
# File 'lib/tolliver/models/notification.rb', line 34 def done sent_count = 0 receivers_count = 0 self.notification_deliveries.each do |notification_delivery| sent_count += notification_delivery.sent_count.to_i receivers_count += notification_delivery.receivers_count.to_i end sent_count.to_s + "/" + receivers_count.to_s end |
#enqueue_for_delivery ⇒ Object
52 53 54 |
# File 'lib/tolliver/models/notification.rb', line 52 def enqueue_for_delivery Tolliver::Services::DeliveryService.instance.enqueue_for_delivery(self) end |
#reset_delivery ⇒ Object
56 57 58 |
# File 'lib/tolliver/models/notification.rb', line 56 def reset_delivery Tolliver::Services::DeliveryService.instance.reset_delivery(self) end |