Class: RuboCop::ConfigObsoletion::ChangedParameter Private
Do not use. This class is for internal use only.
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
ParameterRule ,
Rule
|
|
Instance Chain:
self,
ParameterRule ,
Rule
|
|
Inherits: |
RuboCop::ConfigObsoletion::ParameterRule
|
Defined in: | lib/rubocop/config_obsoletion/changed_parameter.rb |
Overview
Encapsulation of a ConfigObsoletion rule for changing a parameter
Constant Summary
-
BASE_MESSAGE =
# File 'lib/rubocop/config_obsoletion/changed_parameter.rb', line 8'obsolete parameter `%<parameter>s` (for `%<cop>s`) found in %<path>s'
Class Method Summary
Instance Attribute Summary
ParameterRule
- Inherited
#cop, #metadata, #parameter, #parameter_rule?, #violated?, #warning?, #applies_to_current_ruby_version? |
Rule
- Inherited
#cop_rule? | Does this rule relate to cops? |
#parameter_rule? | Does this rule relate to parameters? |
#violated?, #config |
Instance Method Summary
Instance Method Details
#message
[ GitHub ]# File 'lib/rubocop/config_obsoletion/changed_parameter.rb', line 10
def base = format(BASE_MESSAGE, parameter: parameter, cop: cop, path: smart_loaded_path) if alternative "#{base}\n`#{parameter}` has been renamed to `#{alternative.chomp}`." elsif alternatives "#{base}\n`#{parameter}` has been renamed to #{to_sentence(alternatives.map do |item| "`#{item}`" end, connector: 'and/or')}." else "#{base}\n#{reason.chomp}" end end