Class: Contrast::Config::RequestAuditConfiguration

Inherits:
Object
  • Object
show all
Includes:
Contrast::Components::ComponentBase, BaseConfiguration
Defined in:
lib/contrast/config/request_audit_configuration.rb

Overview

This class holds the Common Settings for the hidden functionality of the TS

Constant Summary collapse

DEFAULT_PATH =
'./messages'
CANON_NAME =
'api.request_audit'
CONFIG_VALUES =
%w[enable requests responses path].cs__freeze

Constants included from Contrast::Components::ComponentBase

Contrast::Components::ComponentBase::ENABLE

Constants included from Diagnostics::Tools

Diagnostics::Tools::CHECK

Constants included from Diagnostics::SingletonTools

Diagnostics::SingletonTools::API_CREDENTIALS, Diagnostics::SingletonTools::CONTRAST_MARK

Constants included from BaseConfiguration

BaseConfiguration::AT_UNDERSCORE

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Contrast::Components::ComponentBase

#canon_name, #config_values, #false?, #file_exists?, #stringify_array, #true?, #valid_cert?

Methods included from Diagnostics::Tools

#add_effective_config_values, #add_single_effective_value

Methods included from Diagnostics::SingletonTools

#flatten_settings, #to_config_values, #update_config, #value_to_s

Methods included from BaseConfiguration

#to_contrast_hash

Constructor Details

#initialize(hsh = {}) ⇒ RequestAuditConfiguration

Returns a new instance of RequestAuditConfiguration.



19
20
21
22
23
24
25
26
# File 'lib/contrast/config/request_audit_configuration.rb', line 19

def initialize hsh = {}
  return unless hsh

  @enable = hsh[:enable]
  @requests = hsh[:requests]
  @responses = hsh[:responses]
  @path = hsh[:path]
end

Instance Attribute Details

#enableBoolean, false

Returns:

  • (Boolean, false)


29
30
31
# File 'lib/contrast/config/request_audit_configuration.rb', line 29

def enable
  @enable.nil? ? false : @enable
end

#pathString, ::DEFAULT_PATH

Returns:



44
45
46
# File 'lib/contrast/config/request_audit_configuration.rb', line 44

def path
  @path.nil? ? DEFAULT_PATH : @path
end

#requestsBoolean, false

Returns:

  • (Boolean, false)


34
35
36
# File 'lib/contrast/config/request_audit_configuration.rb', line 34

def requests
  @requests.nil? ? false : @requests
end

#responsesBoolean, false

Returns:

  • (Boolean, false)


39
40
41
# File 'lib/contrast/config/request_audit_configuration.rb', line 39

def responses
  @responses.nil? ? false : @responses
end

Instance Method Details

#to_effective_config(effective_config) ⇒ Object

Converts current configuration to effective config values class and appends them to EffectiveConfig class.

Parameters:



52
53
54
# File 'lib/contrast/config/request_audit_configuration.rb', line 52

def to_effective_config effective_config
  add_effective_config_values(effective_config, CONFIG_VALUES, CANON_NAME)
end