Class: ConfigManager

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(init_yml_file) ⇒ ConfigManager

Returns a new instance of ConfigManager.



7
8
9
# File 'lib/config_manager.rb', line 7

def initialize(init_yml_file)
  @init_file = load init_yml_file
end

Instance Attribute Details

#init_fileObject (readonly)

Returns the value of attribute init_file.



5
6
7
# File 'lib/config_manager.rb', line 5

def init_file
  @init_file
end

Instance Method Details

#get_config_filesObject



15
16
17
# File 'lib/config_manager.rb', line 15

def get_config_files
  @init_file && @init_file.has_key?('files') ? @init_file['files'] : []
end

#load(yml_file) ⇒ Object



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

def load yml_file
  YAML.load_file(yml_file)
end