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
- .new(config, cop, parameter, metadata) ⇒ ParameterRule constructor Internal use only
Rule
- Inherited
Instance Attribute Summary
- #cop readonly Internal use only
- #metadata readonly Internal use only
- #parameter readonly Internal use only
- #parameter_rule? ⇒ Boolean readonly Internal use only
- #violated? ⇒ Boolean readonly Internal use only
- #warning? ⇒ Boolean readonly Internal use only
- #applies_to_current_ruby_version? ⇒ Boolean readonly private Internal use only
Rule
- Inherited
#cop_rule? | Does this rule relate to cops? |
#parameter_rule? | Does this rule relate to parameters? |
#violated?, #config |
Instance Method Summary
- #alternative private Internal use only
- #alternatives private Internal use only
- #reason private Internal use only
- #severity private Internal use only
Rule
- Inherited
Instance Attribute Details
#applies_to_current_ruby_version? ⇒ Boolean
(readonly, private)
# 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 ]#parameter (readonly)
[ GitHub ]# File 'lib/rubocop/config_obsoletion/parameter_rule.rb', line 8
attr_reader :cop, :parameter, :
#parameter_rule? ⇒ Boolean
(readonly)
# File 'lib/rubocop/config_obsoletion/parameter_rule.rb', line 17
def parameter_rule? true end
#violated? ⇒ Boolean
(readonly)
# 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)
# 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