Class: Rails::Queue::ActionMailer::QueuedMessage::DeliveryJob

Inherits:
Object
  • Object
show all
Defined in:
lib/rails/queue/action_mailer/queued_message.rb

Instance Method Summary collapse

Constructor Details

#initialize(mailer_class, method_name, args) ⇒ DeliveryJob

Returns a new instance of DeliveryJob.



25
26
27
28
29
# File 'lib/rails/queue/action_mailer/queued_message.rb', line 25

def initialize(mailer_class, method_name, args)
  @mailer_class = mailer_class
  @method_name  = method_name
  @args         = args
end

Instance Method Details

#messageObject



31
32
33
# File 'lib/rails/queue/action_mailer/queued_message.rb', line 31

def message
  @message ||= @mailer_class.send(:new, @method_name, *@args).message
end

#runObject



35
36
37
# File 'lib/rails/queue/action_mailer/queued_message.rb', line 35

def run
  message.deliver
end