Module: RuboCop::Cop::ConfigurableMax

Overview

Handles Max configuration parameters, especially setting them to an appropriate value with --auto-gen-config.

Instance Method Summary collapse

Instance Method Details

#max=(value) ⇒ Object



8
9
10
11
12
# File 'lib/rubocop/cop/mixin/configurable_max.rb', line 8

def max=(value)
  cfg = self.config_to_allow_offenses ||= {}
  value = [cfg[parameter_name], value].max if cfg[parameter_name]
  cfg[parameter_name] = value
end

#parameter_nameObject



14
15
16
# File 'lib/rubocop/cop/mixin/configurable_max.rb', line 14

def parameter_name
  'Max'
end