Class: ROM::ConfigurationDSL::MapperDSL
- Inherits:
-
Object
- Object
- ROM::ConfigurationDSL::MapperDSL
- Defined in:
- core/lib/rom/configuration_dsl/mapper_dsl.rb
Overview
Mapper definition DSL used by Setup DSL
Instance Attribute Summary collapse
- #configuration ⇒ Object readonly
- #defined_mappers ⇒ Object readonly
- #mapper_classes ⇒ Object readonly
Instance Method Summary collapse
-
#define(name, options = EMPTY_HASH, &block) ⇒ Class
Define a mapper class.
-
#register(relation, mappers) ⇒ Object
TODO.
Instance Attribute Details
#configuration ⇒ Object (readonly)
11 12 13 |
# File 'core/lib/rom/configuration_dsl/mapper_dsl.rb', line 11 def configuration @configuration end |
#defined_mappers ⇒ Object (readonly)
11 12 13 |
# File 'core/lib/rom/configuration_dsl/mapper_dsl.rb', line 11 def defined_mappers @defined_mappers end |
#mapper_classes ⇒ Object (readonly)
11 12 13 |
# File 'core/lib/rom/configuration_dsl/mapper_dsl.rb', line 11 def mapper_classes @mapper_classes end |
Instance Method Details
#define(name, options = EMPTY_HASH, &block) ⇒ Class
Define a mapper class
32 33 34 35 |
# File 'core/lib/rom/configuration_dsl/mapper_dsl.rb', line 32 def define(name, = EMPTY_HASH, &block) @defined_mappers << Mapper::Builder.build_class(name, (@mapper_classes + @defined_mappers), , &block) self end |
#register(relation, mappers) ⇒ Object
TODO
40 41 42 |
# File 'core/lib/rom/configuration_dsl/mapper_dsl.rb', line 40 def register(relation, mappers) configuration.register_mapper(relation => mappers) end |