Module: RuboCop::Cop::ConfigurableMax
- Included in:
- CodeLength, MethodComplexity, Metrics::BlockNesting, Metrics::LineLength, Metrics::ParameterLists, Style::NumericLiterals, Style::WordArray
- 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
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[parameter_name], value].max if cfg[parameter_name] cfg[parameter_name] = value end |
#parameter_name ⇒ Object
14 15 16 |
# File 'lib/rubocop/cop/mixin/configurable_max.rb', line 14 def parameter_name 'Max' end |