Class: Tracebin::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/tracebin/config.rb

Constant Summary collapse

DEFAULTS =
{
  log_level: 'info',
  host: 'https://traceb.in',
  report_path: 'reports',
  enable_ssl: true,
  ignored_paths: [],
  enabled: true,
  report_frequency: 60,
  report_retry_limit: 10
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(config = {}) ⇒ Config

Returns a new instance of Config.



16
17
18
19
20
21
22
23
# File 'lib/tracebin/config.rb', line 16

def initialize(config = {})
  opts = DEFAULTS.merge config
  opts.keys.each do |key|
    if self.respond_to? key
      self.instance_variable_set "@#{key}", opts[key]
    end
  end
end