Class: RedisRing::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/redis_ring/configuration.rb

Constant Summary collapse

PARAMETERS =
[:cluster_name, :host_name, :base_port, :ring_size, :redis_path, :redis_config_template_path,
:total_vm_size, :base_directory, :password, :total_max_memory, :vm_page_size, :zookeeper_address]

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ Configuration

Returns a new instance of Configuration.



14
15
16
17
18
# File 'lib/redis_ring/configuration.rb', line 14

def initialize(params = {})
  set_params(params)
  set_defaults
  validate!
end

Class Method Details

.from_yml(string) ⇒ Object



24
25
26
27
# File 'lib/redis_ring/configuration.rb', line 24

def self.from_yml(string)
  args = YAML::load(string)
  return new(args)
end

.from_yml_file(file_name) ⇒ Object



20
21
22
# File 'lib/redis_ring/configuration.rb', line 20

def self.from_yml_file(file_name)
  return from_yml(File.read(file_name))
end