Class: Cylons::Config

Inherits:
ActiveSupport::InheritableOptions
  • Object
show all
Defined in:
lib/cylons/config.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Config

Returns a new instance of Config.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/cylons/config.rb', line 7

def initialize(*args)
  super(*args)

  self[:address] ||= ::Cylons::Interface.primary
  self[:port] ||= (9000 + rand(100))
  self[:logger] ||= ::Cylons::Logging.logger
  self[:model_paths] ||= nil
  self[:registry] ||= nil
  self[:registry_adapter] ||= :zk
  self[:registry_port] ||= nil
  self[:remote_namespace] ||= nil
  self[:remote_connection_failure_timeout] ||= 10
  self[:remote_connection_failure_threshold] ||= 2
end

Instance Method Details

#registryObject



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

def registry
  @registry ||= ::Cylons::RegistryAdapter.send(self[:registry_adapter])
end