Class: Hanami::Mailer::AttachmentSet Private
- Inherits:
-
Object
- Object
- Hanami::Mailer::AttachmentSet
- Defined in:
- lib/hanami/mailer/attachment_set.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.
A collection of attachments that enforces uniqueness.
Aids the preparation of a single email delivery. It is returned from DSL::Attachments#bind, containing class-level attachment definitions. Runtime attachments can be added via #concat, and the finalized array is obtained via #to_a, which raises if any filenames are duplicated.
Instance Method Summary collapse
- #concat(runtime_attachments) ⇒ Object private
-
#initialize(attachments = []) ⇒ AttachmentSet
constructor
private
A new instance of AttachmentSet.
- #to_a ⇒ Object private
Constructor Details
#initialize(attachments = []) ⇒ AttachmentSet
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 AttachmentSet.
13 14 15 |
# File 'lib/hanami/mailer/attachment_set.rb', line 13 def initialize( = []) @attachments = end |
Instance Method Details
#concat(runtime_attachments) ⇒ 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/mailer/attachment_set.rb', line 17 def concat() Array().each do || @attachments << Attachment.from() end self end |
#to_a ⇒ 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/mailer/attachment_set.rb', line 25 def to_a ensure_unique! @attachments.dup end |