module
Lucky::FormatRegistry
Overview
Registry for custom formats that extends the built-in Format enum
Defined in:
lucky/format_registry.crClass Method Summary
-
.custom_formats
Storage for custom format mappings
-
.from_extension(extension : String) : Lucky::Format | CustomFormat | Nil
Find format by extension (checks both built-in and custom formats)
-
.from_mime_type(mime_type : String) : Lucky::Format | CustomFormat | Nil
Find format by MIME type (checks both built-in and custom formats)
-
.known_extensions : Array(String)
Get all known extensions (built-in + custom)
-
.known_mime_types : Array(String)
Get all known MIME types (built-in + custom)
-
.register(name : String, extension : String, mime_type : String) : Nil
Register a custom format
Class Method Detail
Find format by extension (checks both built-in and custom formats)
Find format by MIME type (checks both built-in and custom formats)
Get all known extensions (built-in + custom)
Get all known MIME types (built-in + custom)