Class: SolidusAdmin::ComponentRegistry
- Inherits:
-
Object
- Object
- SolidusAdmin::ComponentRegistry
- Defined in:
- lib/solidus_admin/component_registry.rb
Constant Summary collapse
- ComponentNotFoundError =
Class.new(NameError)
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
-
#initialize ⇒ ComponentRegistry
constructor
A new instance of ComponentRegistry.
Constructor Details
#initialize ⇒ ComponentRegistry
Returns a new instance of ComponentRegistry.
7 8 9 |
# File 'lib/solidus_admin/component_registry.rb', line 7 def initialize @names = {} end |
Instance Method Details
#[](key) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/solidus_admin/component_registry.rb', line 15 def [](key) if @names[key] @names[key].constantize else infer_constant_from(key) end end |
#[]=(key, value) ⇒ Object
11 12 13 |
# File 'lib/solidus_admin/component_registry.rb', line 11 def []=(key, value) @names[key] = value end |