Class: Qyu::Config::ServiceConfig

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

Direct Known Subclasses

QueueConfig, StoreConfig

Class Method Summary collapse

Class Method Details

.register(adapter_class) ⇒ Class

Register a service (Queue/Store)


14
15
16
# File 'lib/qyu/config.rb', line 14

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

.typesHash

Get registered services


29
30
31
# File 'lib/qyu/config.rb', line 29

def types
  @__types ||= {}
end

.valid?(config) ⇒ Boolean

Validate provided config


22
23
24
# File 'lib/qyu/config.rb', line 22

def valid?(config)
  types[config[:type]].valid_config?(config)
end