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

- old
+ new

@@ -7,26 +7,36 @@ require 'contrast/config/heap_dump_configuration' require 'contrast/config/api_configuration' module Contrast module Config - # Common Configuration settings. Those in this section pertain to the - # core functionality of the Agent. - class AgentConfiguration < BaseConfiguration + # Common Configuration settings. Those in this section pertain to the core functionality of the Agent. + class AgentConfiguration + include Contrast::Config::BaseConfiguration + # @return [Boolean, nil] attr_accessor :enable # @return [Boolean, nil] attr_accessor :omit_body - attr_writer :ruby, :service, :logger, :heap_dump + # @return [Contrast::Config::RubyConfiguration] + attr_writer :ruby + # @return [Contrast::Config::ServiceConfiguration] + attr_writer :service + # @return [ Contrast::Config::LoggerConfiguration] + attr_writer :logger + # @return [Contrast::Config::HeapDumpConfiguration] + attr_writer :heap_dump def initialize hsh = {} - @enable = traverse_config(hsh, :enable) - @start_bundled_service = traverse_config(hsh, :start_bundled_service) - @omit_body = traverse_config(hsh, :omit_body) - @service = Contrast::Config::ServiceConfiguration.new(traverse_config(hsh, :service)) - @logger = Contrast::Config::LoggerConfiguration.new(traverse_config(hsh, :logger)) - @ruby = Contrast::Config::RubyConfiguration.new(traverse_config(hsh, :ruby)) - @heap_dump = Contrast::Config::HeapDumpConfiguration.new(traverse_config(hsh, :heap_dump)) + return unless hsh + + @enable = hsh[:enable] + @start_bundled_service = hsh[:start_bundled_service] + @omit_body = hsh[:omit_body] + @service = Contrast::Config::ServiceConfiguration.new(hsh[:service]) + @logger = Contrast::Config::LoggerConfiguration.new(hsh[:logger]) + @ruby = Contrast::Config::RubyConfiguration.new(hsh[:ruby]) + @heap_dump = Contrast::Config::HeapDumpConfiguration.new(hsh[:heap_dump]) end # @return [Boolean, true] def start_bundled_service @start_bundled_service.nil? ? true : @start_bundled_service