Class: ROM::MapperRegistry

Inherits:
Registry show all
Defined in:
lib/rom/mapper_registry.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ROM::Registry

Instance Attribute Details

#compilerMapperCompiler (readonly)

Returns A mapper compiler instance.

Returns:


17
18
19
# File 'lib/rom/mapper_registry.rb', line 17

option :compiler, default: lambda {
  MapperCompiler.new(EMPTY_HASH, cache: cache)
}

Class Method Details

.element_not_found_errorObject

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.


11
12
13
# File 'lib/rom/mapper_registry.rb', line 11

def self.element_not_found_error
  MapperMissingError
end

Instance Method Details

#[](*args) ⇒ Object

See Also:


23
24
25
26
27
28
29
# File 'lib/rom/mapper_registry.rb', line 23

def [](*args)
  if args[0].is_a?(Symbol)
    super
  else
    cache.fetch_or_store(args.hash) { compiler.(*args) }
  end
end