Class: BundleNotification::Deliver
- Inherits:
-
Object
- Object
- BundleNotification::Deliver
- Defined in:
- lib/bundle_notification/deliver.rb
Instance Attribute Summary collapse
-
#mailer_class ⇒ Object
readonly
Returns the value of attribute mailer_class.
Instance Method Summary collapse
- #deliver_unsent_snippets ⇒ Object
-
#initialize(mailer_class) ⇒ Deliver
constructor
A new instance of Deliver.
Constructor Details
#initialize(mailer_class) ⇒ Deliver
Returns a new instance of Deliver.
9 10 11 |
# File 'lib/bundle_notification/deliver.rb', line 9 def initialize(mailer_class) @mailer_class = mailer_class end |
Instance Attribute Details
#mailer_class ⇒ Object (readonly)
Returns the value of attribute mailer_class.
7 8 9 |
# File 'lib/bundle_notification/deliver.rb', line 7 def mailer_class @mailer_class end |
Instance Method Details
#deliver_unsent_snippets ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/bundle_notification/deliver.rb', line 13 def deliver_unsent_snippets Snippet.transaction do return if unsent_snippets.empty? unsent_snippets.group_by(&:recipient).each do |recipient, snippets| bundle_notify(recipient, snippets.map(&:data)).deliver_later end mark_snippets_sent end end |