Class: Contrast::Config::RequestAuditConfiguration
- 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
Constants included from Diagnostics::SingletonTools
Diagnostics::SingletonTools::API_CREDENTIALS, Diagnostics::SingletonTools::CONTRAST_MARK
Constants included from BaseConfiguration
BaseConfiguration::AT_UNDERSCORE
Instance Attribute Summary collapse
- #enable ⇒ Boolean, false
- #path ⇒ String, ::DEFAULT_PATH
- #requests ⇒ Boolean, false
- #responses ⇒ Boolean, false
Instance Method Summary collapse
-
#initialize(hsh = {}) ⇒ RequestAuditConfiguration
constructor
A new instance of RequestAuditConfiguration.
-
#to_effective_config(effective_config) ⇒ Object
Converts current configuration to effective config values class and appends them to EffectiveConfig class.
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
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
#enable ⇒ Boolean, false
29 30 31 |
# File 'lib/contrast/config/request_audit_configuration.rb', line 29 def enable @enable.nil? ? false : @enable end |
#path ⇒ String, ::DEFAULT_PATH
44 45 46 |
# File 'lib/contrast/config/request_audit_configuration.rb', line 44 def path @path.nil? ? DEFAULT_PATH : @path end |
#requests ⇒ Boolean, false
34 35 36 |
# File 'lib/contrast/config/request_audit_configuration.rb', line 34 def requests @requests.nil? ? false : @requests end |
#responses ⇒ 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.
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 |