Module: ROM::Mapper::DSL::ClassMethods
- Defined in:
- core/lib/rom/mapper/dsl.rb
Overview
Class methods for all mappers
Instance Method Summary collapse
-
#use(plugin, options = {}) ⇒ Object
include a registered plugin in this mapper.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object (private)
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.
Delegate Attribute DSL method to the dsl instance
109 110 111 112 113 114 115 |
# File 'core/lib/rom/mapper/dsl.rb', line 109 def method_missing(name, *args, &block) if dsl.respond_to?(name) dsl.public_send(name, *args, &block) else super end end |
Instance Method Details
#use(plugin, options = {}) ⇒ Object
include a registered plugin in this mapper
40 41 42 43 44 |
# File 'core/lib/rom/mapper/dsl.rb', line 40 def use(plugin, = {}) adapter = .fetch(:adapter, :default) ROM.plugin_registry[:mapper].fetch(plugin, adapter).apply_to(self) end |