Class: Moist::Delivery

Inherits:
Object
  • Object
show all
Defined in:
lib/moist/delivery.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mailing) ⇒ Delivery

Returns a new instance of Delivery.



7
8
9
# File 'lib/moist/delivery.rb', line 7

def initialize(mailing)
  @mailing = mailing
end

Class Method Details

.call(mailing) ⇒ Object



3
4
5
# File 'lib/moist/delivery.rb', line 3

def self.call(mailing)
  new(mailing).call
end

Instance Method Details

#callObject



11
12
13
# File 'lib/moist/delivery.rb', line 11

def call
  @mailing.mailer_class.constantize.send(@mailing.mailer_action, @mailing.moist_campaign_subscriber.subscriber).deliver!
end