config.rb 399 B

12345678910111213141516171819202122
  1. # frozen_string_literal: true
  2. require 'yaml'
  3. # NeoInfra Account information
  4. module NeoInfra
  5. # load the config
  6. class Config
  7. attr_reader :config
  8. def initialize(cfg = 'config.yaml')
  9. @config = YAML.load_file(
  10. File.join(File.dirname(File.expand_path(__FILE__)),
  11. '..', '..', cfg)
  12. )
  13. end
  14. def accounts
  15. @config['accounts']
  16. end
  17. end
  18. end