lib/contrast/config/assess_configuration.rb in contrast-agent-6.0.0 vs lib/contrast/config/assess_configuration.rb in contrast-agent-6.1.0

- old
+ new

@@ -3,27 +3,31 @@ module Contrast module Config # Common Configuration settings. Those in this section pertain to the # assess functionality of the Agent. - class AssessConfiguration < BaseConfiguration + class AssessConfiguration + include Contrast::Config::BaseConfiguration + # @return [String, nil] attr_accessor :tags # @return [Boolean, nil] attr_accessor :enable attr_writer :enable_scan_response, :enable_dynamic_sources, :sampling, :rules, :stacktraces DEFAULT_STACKTRACES = 'ALL' def initialize hsh = {} - @enable = traverse_config(hsh, :enable) - @tags = traverse_config(hsh, :tags) - @enable_scan_response = traverse_config(hsh, :enable_scan_response) - @enable_dynamic_sources = traverse_config(hsh, :enable_dynamic_sources) - @enable_original_object = traverse_config(hsh, :enable_original_object) - @sampling = Contrast::Config::SamplingConfiguration.new(traverse_config(hsh, :sampling)) - @rules = Contrast::Config::AssessRulesConfiguration.new(traverse_config(hsh, :rules)) - @stacktraces = traverse_config(hsh, :stacktraces) + return unless hsh + + @enable = hsh[:enable] + @tags = hsh[:tags] + @enable_scan_response = hsh[:enable_scan_response] + @enable_dynamic_sources = hsh[:enable_dynamic_sources] + @enable_original_object = hsh[:enable_original_object] + @sampling = Contrast::Config::SamplingConfiguration.new(hsh[:sampling]) + @rules = Contrast::Config::AssessRulesConfiguration.new(hsh[:rules]) + @stacktraces = hsh[:stacktraces] end # @return [Boolean, true] def enable_scan_response @enable_scan_response.nil? ? true : @enable_scan_response