Class: Hanami::CLI::Generators::App::Mailer Private

Inherits:
Object
  • Object
show all
Defined in:
lib/hanami/cli/generators/app/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.

Since:

  • 2.0.0

Constant Summary collapse

TEMPLATES_FOLDER =

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.

Since:

  • 2.0.0

"templates/mailers"
DEFAULT_TEMPLATE_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.

Since:

  • 2.0.0

"erb"

Instance Method Summary collapse

Constructor Details

#initialize(fs:, inflector:, out: $stdout) ⇒ 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.

Since:

  • 2.0.0



16
17
18
19
20
# File 'lib/hanami/cli/generators/app/mailer.rb', line 16

def initialize(fs:, inflector:, out: $stdout)
  @fs = fs
  @inflector = inflector
  @out = out
end

Instance Method Details

#call(key:, namespace:, base_path:, template_engine: DEFAULT_TEMPLATE_ENGINE, force: false) ⇒ 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.

Since:

  • 2.0.0



22
23
24
25
26
27
28
# File 'lib/hanami/cli/generators/app/mailer.rb', line 22

def call(key:, namespace:, base_path:, template_engine: DEFAULT_TEMPLATE_ENGINE, force: false, **)
  mailer_class_file(key:, namespace:, base_path:).then do |mailer_class|
    mailer_class.create(force:)
    mailer_class_name = mailer_class.fully_qualified_name
    create_template_files(key:, base_path:, mailer_class_name:, template_engine:, force:)
  end
end