class

Athena::MIME::Part::Data

Inherits Athena::MIME::Part::Text < Athena::MIME::Part::Abstract < Reference < Object

Represents attached/embedded content within the MIME message.

Constructors

from_path(path : String | Path, name : String | Nil = nil, content_type : String | Nil = nil) : self

Creates the part using the contents the file at the provided path as the body, optionally with the provided name and content_type. The file is lazily read.

Source
new(body : String | IO | AMIME::Part::File, filename : String | Nil = nil, content_type : String | Nil = nil, encoding : String | Nil = nil)
Source

Instance methods

as_inline

Marks this part as representing embedded content versus an attached file.

Source
content_id

Returns the content ID of this part, generating a unique one if one was not already set.

Source
content_id=(id : String) : self

Sets the content ID of this part to the provided id.

Source
content_type

Returns the content type of this part.

Source
filename

Returns the name of the file associated with this part.

Source
has_content_id?

Returns true if this part has a #content_id currently set.

Source
media_type

Returns the media type of this part based on its body.

Source
prepared_headers

Returns a cloned AMIME::Header::Collection consisting of a final representation of the headers associated with this message. I.e. Ensures the message's headers include the required ones.

Source