module Athena::MIME::TypesInterface

Overview

Represents a type responsible for managing MIME types and file extensions.

Included Modules

Direct including types

Defined in:

types_interface.cr

Instance Method Summary

Instance methods inherited from module Athena::MIME::TypesGuesserInterface

guess_mime_type(path : String | Path) : String | Nil guess_mime_type, supported? : Bool supported?

Instance Method Detail

abstract def extensions(for mime_type : String) : Enumerable(String) #

Returns the valid file extensions for the provided mime_type in decreasing order of preference.

types.extensions "image/png" # => {"png"}

[View source]
abstract def mime_types(for extension : String) : Enumerable(String) #

Returns the valid MIME types for the provided extension in decreasing order of preference.

types.mime_types "png" # => {"image/png", "image/apng", "image/vnd.mozilla.apng"}

[View source]