Module: Rubocop::Cop::Style::ConfigurableMax

Included in:
BlockNesting, CodeLength, CyclomaticComplexity, LineLength
Defined in:
lib/rubocop/cop/style/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/style/configurable_max.rb', line 9

def max=(value)
  cfg = self.config_to_allow_offences ||= {}
  value = [cfg['Max'], value].max if cfg['Max']
  cfg['Max'] = value
end