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

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

Defined Under Namespace

Classes: DeliveryJob

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(queue, mailer_class, method_name, *args) ⇒ QueuedMessage

Returns a new instance of QueuedMessage.



10
11
12
13
# File 'lib/rails/queue/action_mailer/queued_message.rb', line 10

def initialize(queue, mailer_class, method_name, *args)
  @queue = queue
  @job   = DeliveryJob.new(mailer_class, method_name, args)
end

Instance Attribute Details

#queueObject (readonly)

Returns the value of attribute queue.



8
9
10
# File 'lib/rails/queue/action_mailer/queued_message.rb', line 8

def queue
  @queue
end

Instance Method Details

#__getobj__Object



15
16
17
# File 'lib/rails/queue/action_mailer/queued_message.rb', line 15

def __getobj__
  @job.message
end

#deliverObject

Queues the message for delivery.



20
21
22
# File 'lib/rails/queue/action_mailer/queued_message.rb', line 20

def deliver
  tap { @queue.push @job }
end