diff options
Diffstat (limited to 'actionmailer/lib/action_mailer/queued_message.rb')
-rw-r--r-- | actionmailer/lib/action_mailer/queued_message.rb | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/actionmailer/lib/action_mailer/queued_message.rb b/actionmailer/lib/action_mailer/queued_message.rb deleted file mode 100644 index 8d200617c4..0000000000 --- a/actionmailer/lib/action_mailer/queued_message.rb +++ /dev/null @@ -1,37 +0,0 @@ -require 'delegate' - -module ActionMailer - class QueuedMessage < ::Delegator - attr_reader :queue - - def initialize(queue, mailer_class, method_name, *args) - @queue = queue - @job = DeliveryJob.new(mailer_class, method_name, args) - end - - def __getobj__ - @job.message - end - - # Queues the message for delivery. - def deliver - tap { @queue.push @job } - end - - class DeliveryJob - def initialize(mailer_class, method_name, args) - @mailer_class = mailer_class - @method_name = method_name - @args = args - end - - def message - @message ||= @mailer_class.send(:new, @method_name, *@args).message - end - - def run - message.deliver - end - end - end -end |