Class: Qyu::Factory::ServiceFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/qyu/factory.rb

Direct Known Subclasses

QueueFactory, StoreFactory

Class Method Summary collapse

Class Method Details

.get(config) ⇒ Object



16
17
18
19
# File 'lib/qyu/factory.rb', line 16

def get(config)
  Qyu.logger.info "Got factory #{types[config[:type]]}"
  types[config[:type]].new(config)
end

.register(adapter_class) ⇒ Object



8
9
10
# File 'lib/qyu/factory.rb', line 8

def register(adapter_class)
  types[adapter_class::TYPE] = adapter_class
end

.typesObject



12
13
14
# File 'lib/qyu/factory.rb', line 12

def types
  @__types ||= {}
end