Module: Qe::ActionMailer

Defined in:
lib/qe/action_mailer.rb

Constant Summary collapse

MissingMailNameError =
Class.new(StandardError)
AbstractMethodError =
Class.new(StandardError)

Instance Method Summary collapse

Instance Method Details

#mailObject



6
7
8
9
10
11
# File 'lib/qe/action_mailer.rb', line 6

def mail
  raise MissingMailNameError,
    "the :mail option is not defined" unless options[:mail]

  mailer.public_send(options[:mail], options)
end

#mailerObject



13
14
15
16
# File 'lib/qe/action_mailer.rb', line 13

def mailer
  raise AbstractMethodError,
    "you must implement the mailer method"
end

#performObject



18
19
20
# File 'lib/qe/action_mailer.rb', line 18

def perform
  mail.deliver
end