Class: ROM::MapperRegistry

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

Instance Attribute Summary collapse

Attributes inherited from Registry

#cache, #elements

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Registry

#each, #fetch, #key?, #map, new, #respond_to_missing?

Methods included from Initializer

extended

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:

  • (MapperCompiler)

    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_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.



9
10
11
# File 'lib/rom/mapper_registry.rb', line 9

def self.element_not_found_error
  MapperMissingError
end

Instance Method Details

#[](*args) ⇒ Object

See Also:



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