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, new, #respond_to_missing?
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 |
# File 'lib/rom/mapper_registry.rb', line 15 option :compiler, default: -> { MapperCompiler.new(cache: cache) } |
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
19 20 21 22 23 24 25 |
# File 'lib/rom/mapper_registry.rb', line 19 def [](*args) if args[0].is_a?(Symbol) super else cache.fetch_or_store(args.hash) { compiler.(*args) } end end |