Class: ROM::MapperRegistry
- Defined in:
- lib/rom/mapper_registry.rb
Instance Attribute Summary collapse
-
#compiler ⇒ MapperCompiler
readonly
A mapper compiler instance.
Attributes inherited from Registry
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Registry
#each, #fetch, #key?, #map, #merge, new, #respond_to_missing?, #to_hash
Methods included from Initializer
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ROM::Registry
Instance Attribute Details
#compiler ⇒ MapperCompiler (readonly)
Returns A mapper compiler instance.
15 16 17 |
# File 'lib/rom/mapper_registry.rb', line 15 option :compiler, default: -> do MapperCompiler.new(cache: cache) end |
Class Method Details
.element_not_found_error ⇒ Object
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.
9 10 11 |
# File 'lib/rom/mapper_registry.rb', line 9 def self.element_not_found_error MapperMissingError end |
Instance Method Details
#[](*args) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/rom/mapper_registry.rb', line 21 def [](*args) if args[0].is_a?(Symbol) super else cache.fetch_or_store(args.hash) { compiler.(*args) } end end |