Sha256: 9428213c5277fb63f7c556a57f13cd48e256505ab0849297127da06bf93d3dbe

Contents?: true

Size: 864 Bytes

Versions: 1

Compression:

Stored size: 864 Bytes

Contents

require 'anyway'

module Influxer
  class Config < Anyway::Config
    config_name :influxdb

    attr_config database: 'db', 
                host: 'localhost',
                port: 8083,
                username: 'root',
                password: 'root',
                use_ssl: false,
                async: true,
                cache: false,
                retry: false,
                time_precision: 's',
                initial_delay: 0.01,
                max_delay: 30,
                read_timeout: 30,
                write_timeout: 5

    def load
      super
      # we want pass @cache value as options to cache store, so we want it to be a Hash
      if @cache == true
        @cache = {}
      elsif @cache != false
        # cache keys should be symbols to work as Rails.cache options
        @cache.symbolize_keys!
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
influxer-0.1.1 lib/influxer/config.rb