Class: ActiveRecordDoctor::Config

Inherits:
Struct
  • Object
show all
Defined in:
lib/active_record_doctor/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#detectorsObject

Returns the value of attribute detectors

Returns:

  • (Object)

    the current value of detectors



4
5
6
# File 'lib/active_record_doctor/config.rb', line 4

def detectors
  @detectors
end

#globalsObject

Returns the value of attribute globals

Returns:

  • (Object)

    the current value of globals



4
5
6
# File 'lib/active_record_doctor/config.rb', line 4

def globals
  @globals
end

Instance Method Details

#merge(config) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/active_record_doctor/config.rb', line 5

def merge(config)
  globals = self.globals.merge(config.globals)
  detectors = self.detectors.merge(config.detectors) do |_name, self_settings, config_settings|
    self_settings.merge(config_settings)
  end

  Config.new(globals, detectors)
end