Module: ArMailerRevised

Defined in:
lib/ar_mailer_revised/email_scaffold.rb,
lib/ar_mailer_revised.rb,
lib/ar_mailer_revised/mailman.rb,
lib/ar_mailer_revised/version.rb,
lib/ar_mailer_revised/helpers/general.rb,
lib/ar_mailer_revised/helpers/command_line.rb,
lib/generators/ar_mailer_revised/install_generator.rb

Overview

Helper methods for the chosen email class

Defined Under Namespace

Modules: EmailScaffold, Generators, Helpers Classes: Mailman

Constant Summary collapse

VERSION =
'1.0.3'

Class Method Summary collapse

Class Method Details

.configuration(&proc) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/ar_mailer_revised.rb', line 9

def self.configuration(&proc)
  @@config ||= OpenStruct.new({
                                  :email_class => 'Email'
                              })
  if block_given?
    yield @@config
    @@config.email_class = (@@config.email_class || 'Email').to_s.classify
  else
    @@config
  end
end

.email_classActiveRecord::Base

Returns (Email) The class used to create new emails in the system.

Returns:

  • (ActiveRecord::Base)

    (Email) The class used to create new emails in the system



25
26
27
# File 'lib/ar_mailer_revised.rb', line 25

def self.email_class
  self.email_class_name.constantize
end

.email_class_nameString

Returns (Email) The email class’ name.

Returns:

  • (String)

    (Email) The email class’ name



33
34
35
# File 'lib/ar_mailer_revised.rb', line 33

def self.email_class_name
  @@config.email_class.classify
end