Class: Class

Inherits:
Object
  • Object
show all
Defined in:
lib/carioca/helpers.rb

Overview


Author : Romain GEORGES type : gem component library obj : Carioca Helpers definition Module


Instance Method Summary collapse

Instance Method Details

#preload_service(_options = {}) ⇒ Object

Usage:

prelaod_service :name => 'service', :params => { :arg => 'value'}


11
12
13
# File 'lib/carioca/helpers.rb', line 11

def preload_service(_options = {})
  Carioca::Services::Registry.init.start_service _options
end

#use_configuration(_options = {}) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/carioca/helpers.rb', line 15

def use_configuration(_options = {})
  options = Methodic.get_options(_options)
  options.specify_classes_of :with_file => String
  options.specify_default_value_for :with_file => 'services/registry.yml'
  options.merge
  options.validate!
  Carioca::Services::Registry.init.start_service :name => 'configuration', :params => { :config_file => options[:with_file]}
end