Class: Interfacets::Client::Registry

Inherits:
Object
  • Object
show all
Defined in:
lib/interfacets/client/registry.rb

Instance Method Summary collapse

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