Sha256: 99f18622a768bd28e5921adb489821b10246df83c5b2504787c360870be89506

Contents?: true

Size: 451 Bytes

Versions: 1

Compression:

Stored size: 451 Bytes

Contents

module Vizsla
  class Config
    DEFAULTS = {
      log_level: 'info',
      host: 'http://localhost:3000',
      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.7 lib/vizsla/config.rb