Sha256: 1c3c9891e7ea79d8eb4ad05c2977635ce0e1980365c4f724fd36aaddd3277bb8

Contents?: true

Size: 449 Bytes

Versions: 1

Compression:

Stored size: 449 Bytes

Contents

module Tracebin
  class Config
    DEFAULTS = {
      log_level: 'info',
      host: 'https://traceb.in',
      report_path: 'reports',
      ignored_paths: []
    }.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

1 entries across 1 versions & 1 rubygems

Version Path
tracebin-0.0.8 lib/tracebin/config.rb