Class: Lotus::Commands::Generate::Mailer Private
- Defined in:
- lib/lotus/commands/generate/mailer.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Constant Summary collapse
- TXT_FORMAT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
".txt".freeze
- HTML_FORMAT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
".html".freeze
- DEFAULT_ENGINE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
"erb".freeze
- DEFAULT_FROM =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
"'<from>'".freeze
- DEFAULT_TO =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
"'<to>'".freeze
- DEFAULT_SUBJECT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
"'Hello'".freeze
Instance Attribute Summary collapse
- #from ⇒ Object readonly private
- #name ⇒ Object readonly private
- #name_underscored ⇒ Object readonly private
- #subject ⇒ Object readonly private
- #to ⇒ Object readonly private
Attributes inherited from Abstract
Instance Method Summary collapse
-
#initialize(options, name) ⇒ Mailer
constructor
private
A new instance of Mailer.
- #map_templates ⇒ Object private
- #template_options ⇒ Object private
Methods inherited from Abstract
Methods included from Generators::Generatable
#add_mapping, #destroy, #generator, #post_process_templates, #process_templates, #start, #target_path, #template_source_path
Constructor Details
#initialize(options, name) ⇒ Mailer
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Mailer.
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/lotus/commands/generate/mailer.rb', line 38 def initialize(, name) super() @name_underscored = Utils::String.new(name).underscore @name = Utils::String.new(name_underscored).classify @from = [:from] || DEFAULT_FROM @to = [:to] || DEFAULT_TO @subject = [:subject] || DEFAULT_SUBJECT assert_name! end |
Instance Attribute Details
#from ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 |
# File 'lib/lotus/commands/generate/mailer.rb', line 10 def from @from end |
#name ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 |
# File 'lib/lotus/commands/generate/mailer.rb', line 10 def name @name end |
#name_underscored ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 |
# File 'lib/lotus/commands/generate/mailer.rb', line 10 def name_underscored @name_underscored end |
#subject ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 |
# File 'lib/lotus/commands/generate/mailer.rb', line 10 def subject @subject end |
#to ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 |
# File 'lib/lotus/commands/generate/mailer.rb', line 10 def to @to end |
Instance Method Details
#map_templates ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
52 53 54 55 56 57 |
# File 'lib/lotus/commands/generate/mailer.rb', line 52 def map_templates add_mapping("mailer_spec.rb.tt", mailer_spec_path) add_mapping("mailer.rb.tt", mailer_path) add_mapping("template.txt.tt", txt_template_path) add_mapping("template.html.tt", html_template_path) end |
#template_options ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
59 60 61 62 63 64 65 66 |
# File 'lib/lotus/commands/generate/mailer.rb', line 59 def { mailer: name, from: from, to: to, subject: subject, } end |