Class: ConfigManager
- Inherits:
-
Object
- Object
- ConfigManager
- Defined in:
- lib/config_manager.rb
Instance Attribute Summary collapse
-
#init_file ⇒ Object
readonly
Returns the value of attribute init_file.
Instance Method Summary collapse
- #get_config_files ⇒ Object
-
#initialize(init_yml_file) ⇒ ConfigManager
constructor
A new instance of ConfigManager.
- #load(yml_file) ⇒ Object
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_file ⇒ Object (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_files ⇒ Object
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 |