Skip to content

class Athena::MIME::Part::File
inherits Reference #

An abstraction that allows representing a file without needing to keep the file open.

Constructors#

.new(path : String | Path, filename : String | Nil = nil)#

Methods#

#content_type : String#

Attempts to guess the content type of the file based on its path. Falls back to application/octet-stream.

#filename : String#

Returns the name of the file, inferring it based on the basename of its path if not provided explicitly.

#path : String#

Returns the path to the file on the filesystem.

#size : Int#

Returns the size of the file in bytes.