Class: ConfigurationLoader
- Defined in:
- lib/shot/configuration_loader.rb
Instance Attribute Summary
Attributes inherited from Loader
Instance Method Summary collapse
- #get(config_file) ⇒ Object
- #get_all ⇒ Object
-
#initialize(client) ⇒ ConfigurationLoader
constructor
A new instance of ConfigurationLoader.
Constructor Details
#initialize(client) ⇒ ConfigurationLoader
Returns a new instance of ConfigurationLoader.
15 16 17 18 19 |
# File 'lib/shot/configuration_loader.rb', line 15 def initialize(client) super(client) @type = 'config' get_all end |
Instance Method Details
#get(config_file) ⇒ Object
21 22 23 24 25 |
# File 'lib/shot/configuration_loader.rb', line 21 def get(config_file) if config_folder_exists and config_file_exists config_file then @client.config[config_file] = YAML.load File.read "./app/config/#{config_file}.yml" end end |
#get_all ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/shot/configuration_loader.rb', line 27 def get_all if config_folder_exists config_folder = Dir.new './app/config/' config_folder.each do |file| if file != '.' and file != '..' file['.yml'] = '' get file end end end end |