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 = config_to_allow_offenses
  value = [cfg[max_parameter_name], value].max if cfg[max_parameter_name]
  cfg[max_parameter_name] = value
end

#max_parameter_nameObject



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

def max_parameter_name
  'Max'
end