Class: SolidusAdmin::ComponentRegistry

Inherits:
Object
  • Object
show all
Defined in:
lib/solidus_admin/component_registry.rb

Constant Summary collapse

ComponentNotFoundError =
Class.new(NameError)

Instance Method Summary collapse

Constructor Details

#initializeComponentRegistry

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