Class: Woods::Notion::Mapper
- Inherits:
-
Object
- Object
- Woods::Notion::Mapper
- Defined in:
- lib/woods/notion/mapper.rb
Overview
Dispatcher for Notion mappers. Returns the appropriate mapper for a unit type.
Constant Summary collapse
- REGISTRY =
{ 'model' => Mappers::ModelMapper, 'column' => Mappers::ColumnMapper, 'migration' => Mappers::MigrationMapper }.freeze
Class Method Summary collapse
-
.for(type) ⇒ Object?
Get a mapper instance for a unit type.
-
.supported_types ⇒ Array<String>
List all supported unit types.
Class Method Details
.for(type) ⇒ Object?
Get a mapper instance for a unit type.
27 28 29 30 |
# File 'lib/woods/notion/mapper.rb', line 27 def self.for(type) klass = REGISTRY[type] klass&.new end |
.supported_types ⇒ Array<String>
List all supported unit types.
35 36 37 |
# File 'lib/woods/notion/mapper.rb', line 35 def self.supported_types REGISTRY.keys end |