Sha256: 6fee33ef67485a2769127bd197d316975d4b934c1fd9cd9eceafe782ae9064ef

Contents?: true

Size: 552 Bytes

Versions: 2

Compression:

Stored size: 552 Bytes

Contents

module Tracebin
  class Config
    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

    attr_accessor *(DEFAULTS.keys + [:bin_id])

    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
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tracebin-0.0.13 lib/tracebin/config.rb
tracebin-0.0.12 lib/tracebin/config.rb