Class: MicroQ::Proxy::ActionMailer

Inherits:
Base
  • Object
show all
Defined in:
lib/micro_q/proxies/action_mailer.rb

Instance Attribute Summary

Attributes inherited from Base

#args, #at, #errors, #klass, #method

Instance Method Summary collapse

Methods inherited from Base

#initialize, #respond_to?, #valid?

Constructor Details

This class inherits a constructor from MicroQ::Proxy::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/micro_q/proxies/action_mailer.rb', line 4

def method_missing(meth, *args)
  @args = [@options.delete(:base).to_s, meth.to_s, *args]

  defaults = [{
    :class => MicroQ::Wrapper::ActionMailer,
    :method => 'perform',
    :args => @args
  }.merge(@options)]

  defaults << { :when => at } if at

  MicroQ.push(*defaults)
end