module Lucky::FormatRegistry

Overview

Registry for custom formats that extends the built-in Format enum

Defined in:

lucky/format_registry.cr

Class Method Summary

Class Method Detail

def self.custom_formats #

Storage for custom format mappings


[View source]
def self.from_extension(extension : String) : Lucky::Format | CustomFormat | Nil #

Find format by extension (checks both built-in and custom formats)


[View source]
def self.from_mime_type(mime_type : String) : Lucky::Format | CustomFormat | Nil #

Find format by MIME type (checks both built-in and custom formats)


[View source]
def self.known_extensions : Array(String) #

Get all known extensions (built-in + custom)


[View source]
def self.known_mime_types : Array(String) #

Get all known MIME types (built-in + custom)


[View source]
def self.register(name : String, extension : String, mime_type : String) : Nil #

Register a custom format


[View source]