Module: Datamappify::Repository::MappingDSL
- Includes:
- LazyChecking
- Defined in:
- lib/datamappify/repository/mapping_dsl.rb
Instance Method Summary collapse
- #default_provider(provider_name) ⇒ void
-
#for_entity(entity_class) ⇒ void
If the entity is lazy loaded then it assigns the repository itself back to the entity.
- #group(options = {}) { ... } ⇒ void
- #map_attribute(name, options = {}) ⇒ void
Methods included from LazyChecking
#assign_to_entity, #lazy_load?
Instance Method Details
#default_provider(provider_name) ⇒ void
This method returns an undefined value.
22 23 24 |
# File 'lib/datamappify/repository/mapping_dsl.rb', line 22 def default_provider(provider_name) data_mapper.default_provider_name = provider_name.to_s end |
#for_entity(entity_class) ⇒ void
This method returns an undefined value.
If the entity is lazy loaded then it assigns the repository itself back to the entity
12 13 14 15 16 |
# File 'lib/datamappify/repository/mapping_dsl.rb', line 12 def for_entity(entity_class) data_mapper.entity_class = entity_class assign_to_entity if lazy_load? end |
#group(options = {}) { ... } ⇒ void
This method returns an undefined value.
39 40 41 42 43 44 45 |
# File 'lib/datamappify/repository/mapping_dsl.rb', line 39 def group( = {}, &block) self. = block.call self. = {} end |
#map_attribute(name, options = {}) ⇒ void
This method returns an undefined value.
29 30 31 |
# File 'lib/datamappify/repository/mapping_dsl.rb', line 29 def map_attribute(name, = {}) data_mapper.custom_mapping[name.to_sym] = self..merge() end |