Module: Reek::Configuration::DefaultDirective

Includes:
ConfigurationValidator
Defined in:
lib/reek/configuration/default_directive.rb

Overview

Hash extension for the default directive.

Instance Method Summary collapse

Methods included from ConfigurationValidator

#key_to_smell_detector, #smell_type?, #with_valid_directory

Instance Method Details

#add(detectors_configuration) ⇒ self

Adds the configuration for detectors as default directive.

Parameters:

  • detectors_configuration (Hash)

    the configuration e.g.:

    :IrresponsibleModule => {:enabled=>false,
    :Attribute => :enabled=>true
    

    }

Returns:

  • (self)


22
23
24
25
26
27
28
# File 'lib/reek/configuration/default_directive.rb', line 22

def add(detectors_configuration)
  detectors_configuration.each do |name, configuration|
    detector = key_to_smell_detector(name)
    self[detector] = (self[detector] || {}).merge configuration
  end
  self
end