Class: ATS::Configuration
- Inherits:
-
Object
- Object
- ATS::Configuration
- Defined in:
- lib/ats/configuration.rb
Instance Attribute Summary collapse
-
#config_files ⇒ Object
Returns the value of attribute config_files.
-
#debug ⇒ Object
Returns the value of attribute debug.
-
#logger ⇒ Object
Returns the value of attribute logger.
Instance Method Summary collapse
- #fetch(key) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #to_h ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/ats/configuration.rb', line 5 def initialize @logger = Logger.new(STDOUT) @logger.level = Logger::DEBUG @debug = false @config_files = [ File.join(Dir.home, ".atsrc"), File.('.atsrc'), ENV['ATSRC'] ].compact end |
Instance Attribute Details
#config_files ⇒ Object
Returns the value of attribute config_files.
3 4 5 |
# File 'lib/ats/configuration.rb', line 3 def config_files @config_files end |
#debug ⇒ Object
Returns the value of attribute debug.
3 4 5 |
# File 'lib/ats/configuration.rb', line 3 def debug @debug end |
#logger ⇒ Object
Returns the value of attribute logger.
3 4 5 |
# File 'lib/ats/configuration.rb', line 3 def logger @logger end |
Instance Method Details
#fetch(key) ⇒ Object
16 17 18 |
# File 'lib/ats/configuration.rb', line 16 def fetch(key) hash.fetch(key.to_sym) end |
#to_h ⇒ Object
20 21 22 |
# File 'lib/ats/configuration.rb', line 20 def to_h hash.dup end |