Class: Lutaml::Xsd::Formatters::FormatterFactory
- Inherits:
-
Object
- Object
- Lutaml::Xsd::Formatters::FormatterFactory
- Defined in:
- lib/lutaml/xsd/formatters/formatter_factory.rb
Overview
Factory for creating formatter instances Provides a centralized way to create formatters based on format strings. Uses Registry internally for dynamic formatter registration.
Class Method Summary collapse
-
.create(format) ⇒ Base
Create a formatter instance for the specified format.
-
.register(name, formatter_class) ⇒ void
Register a new formatter class This allows runtime registration of custom formatters.
-
.registry ⇒ Registry
private
Access the internal registry (for testing or advanced usage).
-
.supported?(format) ⇒ Boolean
Check if a format is supported.
-
.supported_formats ⇒ Array<String>
Get list of supported format names.
Class Method Details
.create(format) ⇒ Base
Create a formatter instance for the specified format
27 28 29 |
# File 'lib/lutaml/xsd/formatters/formatter_factory.rb', line 27 def create(format) @registry.create(format) end |
.register(name, formatter_class) ⇒ void
This method returns an undefined value.
Register a new formatter class This allows runtime registration of custom formatters
53 54 55 |
# File 'lib/lutaml/xsd/formatters/formatter_factory.rb', line 53 def register(name, formatter_class) @registry.register(name, formatter_class) end |
.registry ⇒ Registry
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Access the internal registry (for testing or advanced usage)
61 62 63 |
# File 'lib/lutaml/xsd/formatters/formatter_factory.rb', line 61 def registry @registry end |
.supported?(format) ⇒ Boolean
Check if a format is supported
42 43 44 |
# File 'lib/lutaml/xsd/formatters/formatter_factory.rb', line 42 def supported?(format) @registry.supported?(format) end |
.supported_formats ⇒ Array<String>
Get list of supported format names
34 35 36 |
# File 'lib/lutaml/xsd/formatters/formatter_factory.rb', line 34 def supported_formats @registry.supported_formats end |