Class: ConfigLoader
- Inherits:
-
Object
- Object
- ConfigLoader
- Defined in:
- lib/config_loader.rb
Instance Attribute Summary collapse
-
#config_params ⇒ Object
Returns the value of attribute config_params.
Instance Method Summary collapse
-
#initialize(config_string) ⇒ ConfigLoader
constructor
A new instance of ConfigLoader.
-
#servers ⇒ Object
Treat servers like each.
Constructor Details
#initialize(config_string) ⇒ ConfigLoader
Returns a new instance of ConfigLoader.
8 9 10 |
# File 'lib/config_loader.rb', line 8 def initialize(config_string) @config_params = YAML::load(config_string) end |
Instance Attribute Details
#config_params ⇒ Object
Returns the value of attribute config_params.
6 7 8 |
# File 'lib/config_loader.rb', line 6 def config_params @config_params end |
Instance Method Details
#servers ⇒ Object
Treat servers like each. I would have used the name each, but I wanted to give the user some idea of what information they should be getting.
16 17 18 19 20 21 22 23 |
# File 'lib/config_loader.rb', line 16 def servers server_list = @config_params server_list.each do |i| yield i end end |