Class: RuboCop::ConfigObsoletion::ParameterRule Private
- Defined in:
- lib/rubocop/config_obsoletion/parameter_rule.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Base class for ConfigObsoletion rules relating to parameters
Direct Known Subclasses
Instance Attribute Summary collapse
- #cop ⇒ Object readonly private
- #metadata ⇒ Object readonly private
- #parameter ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(config, cop, parameter, metadata) ⇒ ParameterRule
constructor
private
A new instance of ParameterRule.
- #parameter_rule? ⇒ Boolean private
- #violated? ⇒ Boolean private
- #warning? ⇒ Boolean private
Methods inherited from Rule
Constructor Details
#initialize(config, cop, parameter, metadata) ⇒ ParameterRule
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of ParameterRule.
10 11 12 13 14 15 |
# File 'lib/rubocop/config_obsoletion/parameter_rule.rb', line 10 def initialize(config, cop, parameter, ) super(config) @cop = cop @parameter = parameter @metadata = end |
Instance Attribute Details
#cop ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
8 9 10 |
# File 'lib/rubocop/config_obsoletion/parameter_rule.rb', line 8 def cop @cop end |
#metadata ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
8 9 10 |
# File 'lib/rubocop/config_obsoletion/parameter_rule.rb', line 8 def @metadata end |
#parameter ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
8 9 10 |
# File 'lib/rubocop/config_obsoletion/parameter_rule.rb', line 8 def parameter @parameter end |
Instance Method Details
#parameter_rule? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
17 18 19 |
# File 'lib/rubocop/config_obsoletion/parameter_rule.rb', line 17 def parameter_rule? true end |
#violated? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
21 22 23 |
# File 'lib/rubocop/config_obsoletion/parameter_rule.rb', line 21 def violated? applies_to_current_ruby_version? && config[cop]&.key?(parameter) end |
#warning? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
25 26 27 |
# File 'lib/rubocop/config_obsoletion/parameter_rule.rb', line 25 def warning? severity == 'warning' end |