Class: Hanami::Mailer::DSL::Attachment Private

Inherits:
Object
  • Object
show all
Defined in:
lib/hanami/mailer/dsl/attachments.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 class-level attachment definition.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name_or_filename, proc = nil, **options) ⇒ Attachment

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 Attachment.



47
48
49
50
51
# File 'lib/hanami/mailer/dsl/attachments.rb', line 47

def initialize(name_or_filename, proc = nil, **options)
  @name_or_filename = name_or_filename
  @proc = proc
  @options = options
end

Instance Attribute Details

#name_or_filenameObject (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.



45
46
47
# File 'lib/hanami/mailer/dsl/attachments.rb', line 45

def name_or_filename
  @name_or_filename
end

#optionsObject (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.



45
46
47
# File 'lib/hanami/mailer/dsl/attachments.rb', line 45

def options
  @options
end

#procObject (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.



45
46
47
# File 'lib/hanami/mailer/dsl/attachments.rb', line 45

def proc
  @proc
end

Instance Method Details

#bind(obj) ⇒ 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.



58
59
60
# File 'lib/hanami/mailer/dsl/attachments.rb', line 58

def bind(obj)
  BoundAttachment.new(name_or_filename, proc, obj, **options)
end