class Athena::MIME::Part::Data

Overview

Represents attached/embedded content within the MIME message.

Direct Known Subclasses

Defined in:

part/data.cr

Constructors

Instance Method Summary

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

def self.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.


[View source]
def self.new(body : String | IO | AMIME::Part::File, filename : String | Nil = nil, content_type : String | Nil = nil, encoding : String | Nil = nil) #

[View source]

Instance Method Detail

def as_inline : self #

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


[View source]
def content_id : String #

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


[View source]
def content_id=(id : String) : self #

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


[View source]
def content_type : String #

Returns the content type of this part.


[View source]
def filename : String | Nil #

Returns the name of the file associated with this part.


[View source]
def has_content_id? : Bool #

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


[View source]
def media_type : String #

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


[View source]
def prepared_headers : AMIME::Header::Collection #

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.


[View source]