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.
10 11 12 |
# File 'lib/bundle_notification/deliver.rb', line 10 def initialize(mailer_class) @mailer_class = mailer_class end |
Instance Attribute Details
#mailer_class ⇒ Object (readonly)
Returns the value of attribute mailer_class.
8 9 10 |
# File 'lib/bundle_notification/deliver.rb', line 8 def mailer_class @mailer_class end |
Instance Method Details
#deliver_unsent_snippets ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/bundle_notification/deliver.rb', line 14 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 |