123456789_123456789_123456789_123456789_123456789_

Class: RuboCop::ConfigObsoletion::ParameterRule Private

Do not use. This class is for internal use only.
Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Subclasses:
RuboCop::ConfigObsoletion::ChangedEnforcedStyles, RuboCop::ConfigObsoletion::ChangedParameter
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Rule
Instance Chain:
self, Rule
Inherits: RuboCop::ConfigObsoletion::Rule
Defined in: lib/rubocop/config_obsoletion/parameter_rule.rb

Overview

Base class for ConfigObsoletion rules relating to parameters

Class Method Summary

Rule - Inherited

Instance Attribute Summary

Rule - Inherited

#cop_rule?

Does this rule relate to cops?

#parameter_rule?

Does this rule relate to parameters?

#violated?, #config

Instance Method Summary

Rule - Inherited

Instance Attribute Details

#applies_to_current_ruby_version?Boolean (readonly, private)

[ GitHub ]

  
# File 'lib/rubocop/config_obsoletion/parameter_rule.rb', line 31

def applies_to_current_ruby_version?
  minimum_ruby_version = ['minimum_ruby_version']

  return true unless minimum_ruby_version

  config.target_ruby_version >= minimum_ruby_version
end

#cop (readonly)

[ GitHub ]

  
# File 'lib/rubocop/config_obsoletion/parameter_rule.rb', line 8

attr_reader :cop, :parameter, :

#metadata (readonly)

[ GitHub ]

  
# File 'lib/rubocop/config_obsoletion/parameter_rule.rb', line 8

attr_reader :cop, :parameter, :

#parameter (readonly)

[ GitHub ]

  
# File 'lib/rubocop/config_obsoletion/parameter_rule.rb', line 8

attr_reader :cop, :parameter, :

#parameter_rule?Boolean (readonly)

[ GitHub ]

  
# File 'lib/rubocop/config_obsoletion/parameter_rule.rb', line 17

def parameter_rule?
  true
end

#violated?Boolean (readonly)

[ GitHub ]

  
# File 'lib/rubocop/config_obsoletion/parameter_rule.rb', line 21

def violated?
  applies_to_current_ruby_version? && config[cop]&.key?(parameter)
end

#warning?Boolean (readonly)

[ GitHub ]

  
# File 'lib/rubocop/config_obsoletion/parameter_rule.rb', line 25

def warning?
  severity == 'warning'
end

Instance Method Details

#alternative (private)

[ GitHub ]

  
# File 'lib/rubocop/config_obsoletion/parameter_rule.rb', line 39

def alternative
  ['alternative']
end

#alternatives (private)

[ GitHub ]

  
# File 'lib/rubocop/config_obsoletion/parameter_rule.rb', line 43

def alternatives
  ['alternatives']
end

#reason (private)

[ GitHub ]

  
# File 'lib/rubocop/config_obsoletion/parameter_rule.rb', line 47

def reason
  ['reason']
end

#severity (private)

[ GitHub ]

  
# File 'lib/rubocop/config_obsoletion/parameter_rule.rb', line 51

def severity
  ['severity']
end