Class: Hanami::RSpec::Generators::Mailer Private
- Inherits:
-
Object
- Object
- Hanami::RSpec::Generators::Mailer
- Defined in:
- lib/hanami/rspec/generators/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.
Instance Attribute Summary collapse
- #fs ⇒ Object readonly private
- #inflector ⇒ Object readonly private
Instance Method Summary collapse
- #call(key:, namespace:, base_path:) ⇒ Object private
-
#initialize(fs:, inflector:) ⇒ Mailer
constructor
private
A new instance of Mailer.
Constructor Details
#initialize(fs:, inflector:) ⇒ 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.
12 13 14 15 |
# File 'lib/hanami/rspec/generators/mailer.rb', line 12 def initialize(fs:, inflector:) @fs = fs @inflector = inflector end |
Instance Attribute Details
#fs ⇒ 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/hanami/rspec/generators/mailer.rb', line 10 def fs @fs end |
#inflector ⇒ 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/hanami/rspec/generators/mailer.rb', line 10 def inflector @inflector end |
Instance Method Details
#call(key:, namespace:, base_path:) ⇒ 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.
17 18 19 20 21 22 23 |
# File 'lib/hanami/rspec/generators/mailer.rb', line 17 def call(key:, namespace:, base_path:) mailer_class_file = mailer_class_file(key:, namespace:, base_path:) spec_file_path = mailer_class_file.path.gsub(/\.rb$/, "_spec.rb") mailer_class_name = mailer_class_file.fully_qualified_name fs.write(spec_file_path, spec_content(mailer_class_name)) end |