Class: Hanami::Extensions::Mailer::SliceConfiguredMailer Private
- Inherits:
-
Module
- Object
- Module
- Hanami::Extensions::Mailer::SliceConfiguredMailer
- Defined in:
- lib/hanami/extensions/mailer/slice_configured_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.
Provides slice-specific configuration and behavior for any mailer class defined within a slice’s module namespace.
This injects the slice’s ‘“mailers.delivery_method”` component into mailer instances, and points the mailer’s view at a slice-configured view class so that mailer templates behave like regular Hanami view templates — sharing the slice’s view context, parts, scopes and helpers (including i18n). The only behavior not available to mailer views is request-related state (‘request`/`session`/`flash`/`csrf_token`), since mailers are not rendered from a request.
Instance Attribute Summary collapse
- #slice ⇒ Object readonly private
Instance Method Summary collapse
- #extended(mailer_class) ⇒ Object private
-
#initialize(slice) ⇒ SliceConfiguredMailer
constructor
private
A new instance of SliceConfiguredMailer.
- #inspect ⇒ Object private
Constructor Details
#initialize(slice) ⇒ SliceConfiguredMailer
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 SliceConfiguredMailer.
20 21 22 23 |
# File 'lib/hanami/extensions/mailer/slice_configured_mailer.rb', line 20 def initialize(slice) super() @slice = slice end |
Instance Attribute Details
#slice ⇒ 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.
18 19 20 |
# File 'lib/hanami/extensions/mailer/slice_configured_mailer.rb', line 18 def slice @slice end |
Instance Method Details
#extended(mailer_class) ⇒ 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.
25 26 27 28 |
# File 'lib/hanami/extensions/mailer/slice_configured_mailer.rb', line 25 def extended(mailer_class) configure_mailer(mailer_class) define_new end |
#inspect ⇒ 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.
30 31 32 |
# File 'lib/hanami/extensions/mailer/slice_configured_mailer.rb', line 30 def inspect "#<#{self.class.name}[#{slice.name}]>" end |