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
- .configuration(&proc) ⇒ Object
-
.email_class ⇒ ActiveRecord::Base
(Email) The class used to create new emails in the system.
-
.email_class_name ⇒ String
(Email) The email class’ name.
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_class ⇒ ActiveRecord::Base
Returns (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_name ⇒ String
Returns (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 |