Class: Interfacets::Client::Registry
- Inherits:
-
Object
- Object
- Interfacets::Client::Registry
- Defined in:
- lib/interfacets/client/registry.rb
Instance Method Summary collapse
- #build(name, id) ⇒ Object
-
#initialize ⇒ Registry
constructor
A new instance of Registry.
Constructor Details
#initialize ⇒ Registry
Returns a new instance of Registry.
6 7 8 |
# File 'lib/interfacets/client/registry.rb', line 6 def initialize @stores = {} end |
Instance Method Details
#build(name, id) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/interfacets/client/registry.rb', line 10 def build(name, id) entity = Object.const_get(name).client_entity_class @stores[id] ||= entity.store.new entity.new( store: @stores[id], parent: nil, nesting: ["root"] ) end |