class Athena::MIME::Part::Data
Overview
Represents attached/embedded content within the MIME message.
Direct Known Subclasses
Defined in:
part/data.crConstructors
-
.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.
- .new(body : String | IO | AMIME::Part::File, filename : String | Nil = nil, content_type : String | Nil = nil, encoding : String | Nil = nil)
Instance Method Summary
-
#as_inline : self
Marks this part as representing embedded content versus an attached file.
-
#content_id : String
Returns the content ID of this part, generating a unique one if one was not already set.
-
#content_id=(id : String) : self
Sets the content ID of this part to the provided id.
-
#content_type : String
Returns the content type of this part.
-
#filename : String | Nil
Returns the name of the file associated with this part.
-
#has_content_id? : Bool
Returns
true
if this part has a#content_id
currently set. -
#media_type : String
Returns the media type of this part based on its body.
-
#prepared_headers : AMIME::Header::Collection
Returns a cloned
AMIME::Header::Collection
consisting of a final representation of the headers associated with this message.
Instance methods inherited from class Athena::MIME::Part::Text
body : String
body,
disposition : String | Nil
disposition,
disposition=(disposition : String | Nil)
disposition=,
media_sub_type : String
media_sub_type,
media_type : String
media_type,
name : String | Nil
name,
name=(name : String | Nil)
name=,
prepared_headers : AMIME::Header::Collection
prepared_headers
Constructor methods inherited from class Athena::MIME::Part::Text
new(body : String | IO | AMIME::Part::File, charset : String | Nil = "UTF-8", sub_type : String = "plain", encoding : String | Nil = nil)
new
Instance methods inherited from class Athena::MIME::Part::Abstract
body_to_s : String
body_to_s,
headers : AMIME::Header::Collection
headers,
media_sub_type : String
media_sub_type,
media_type : String
media_type,
prepared_headers : AMIME::Header::Collection
prepared_headers
Constructor Detail
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.
Instance Method Detail
Returns the content ID of this part, generating a unique one if one was not already set.
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.