Module: Thron::Config
Constant Summary collapse
Instance Method Summary collapse
Instance Method Details
#circuit_breaker ⇒ Object
27 28 29 |
# File 'lib/thron/config.rb', line 27 def circuit_breaker @circuit_breaker ||= OpenStruct.new(dump_yaml['circuit_breaker']) end |
#dump_yaml ⇒ Object
14 15 16 17 |
# File 'lib/thron/config.rb', line 14 def dump_yaml Dotenv.load @yaml ||= YAML.load(ERB.new(File.read(CONFIG_YML)).result) end |
#logger ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/thron/config.rb', line 19 def logger @logger ||= begin level = dump_yaml.fetch('logger').fetch('level') verbose = dump_yaml.fetch('logger').fetch('verbose') OpenStruct.new(level: Logger::const_get(level.upcase), verbose: verbose) end end |
#thron ⇒ Object
31 32 33 |
# File 'lib/thron/config.rb', line 31 def thron @thron ||= OpenStruct.new(dump_yaml['thron']) end |