class RequestHeadersLogger::Configuration

Constants

CONFIG_KEYS
LOG_FORMATS
TAG_FORMATS

Public Class Methods

new() click to toggle source
# File lib/request_headers_logger/configuration.rb, line 19
def initialize
  @configs = {
    log_format: LOG_FORMATS.first,
    tag_format: TAG_FORMATS.first
  }
end

Public Instance Methods

[](key) click to toggle source
# File lib/request_headers_logger/configuration.rb, line 32
def [](key)
  @configs[key]
end
[]=(key, value) click to toggle source
# File lib/request_headers_logger/configuration.rb, line 26
def []=(key, value)
  raise InvalidKey, key unless CONFIG_KEYS.include?(key)

  @configs[key] = value
end
log_format() click to toggle source
# File lib/request_headers_logger/configuration.rb, line 36
def log_format
  LOG_FORMATS.include?(@configs[:log_format]) ? @configs[:log_format] : LOG_FORMATS.first
end
tag_format() click to toggle source
# File lib/request_headers_logger/configuration.rb, line 40
def tag_format
  TAG_FORMATS.include?(@configs[:tag_format]) ? @configs[:tag_format] : TAG_FORMATS.first
end