Sha256: ae93294f46b524c6cdc09f8611a96abc574df5b31e7049420aaadab8fb46b558

Contents?: true

Size: 902 Bytes

Versions: 1

Compression:

Stored size: 902 Bytes

Contents

# frozen_string_literal: true

require "anyway_config"

module Sniffer
  # Sniffer configuration
  class Config < Anyway::Config
    config_name :sniffer

    attr_config logger: Logger.new($stdout),
                severity: Logger::Severity::DEBUG,
                log: {
                  request_url: true,
                  request_headers: true,
                  request_body: true,
                  request_method: true,
                  response_status: true,
                  response_headers: true,
                  response_body: true,
                  timing: true
                },
                store: true,
                enabled: false

    def capacity?
      store.is_a?(Hash) && store.key?(:capacity)
    end

    def capacity
      store.fetch(:capacity).to_i
    end

    def rotate?
      return false unless capacity?
      store.fetch(:rotate, true)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sniffer-0.2.0 lib/sniffer/config.rb