Module: RuboCop::Cop::ConfigurableMax

Included in:
CodeLength, MethodComplexity, Metrics::BlockNesting, Metrics::LineLength, Metrics::ParameterLists, Style::NumericLiterals
Defined in:
lib/rubocop/cop/mixin/configurable_max.rb

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



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

def max=(value)
  cfg = config_to_allow_offenses
  value = [cfg[parameter_name], value].max if cfg[parameter_name]
  cfg[parameter_name] = value
end

#parameter_nameObject



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

def parameter_name
  'Max'
end