Class: Core::Registry
- Inherits:
-
Object
show all
- Includes:
- Logging, Singleton
- Defined in:
- app/api/core/registry.rb
Constant Summary
collapse
- RegistryError =
Class.new(StandardError)
- AlreadyRegisteredError =
Class.new(RegistryError)
- UnregisteredError =
Class.new(RegistryError)
Instance Method Summary
collapse
Methods included from Logging
logging_helper, #low_level
Constructor Details
Returns a new instance of Registry.
11
12
13
|
# File 'app/api/core/registry.rb', line 11
def initialize
@model_class_to_target = {}
end
|
Instance Method Details
#inspect ⇒ Object
43
44
45
|
# File 'app/api/core/registry.rb', line 43
def inspect
@model_class_to_target.to_h { |k, v| [k.to_s, v.to_s] }.inspect
end
|
#lookup_for_class(model_class) ⇒ Object
35
36
37
|
# File 'app/api/core/registry.rb', line 35
def lookup_for_class(model_class)
lookup(model_class)
end
|
#lookup_for_object(model_instance) ⇒ Object
39
40
41
|
# File 'app/api/core/registry.rb', line 39
def lookup_for_object(model_instance)
lookup(model_instance.class)
end
|