123456789_123456789_123456789_123456789_123456789_

Class: RuboCop::ConfigObsoletion::ChangedEnforcedStyles Private

Do not use. This class is for internal use only.
Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: RuboCop::ConfigObsoletion::ParameterRule
Defined in: lib/rubocop/config_obsoletion/changed_enforced_styles.rb

Overview

Encapsulation of a ConfigObsoletion rule for changing a parameter

Constant Summary

Class Method Summary

ParameterRule - Inherited

Rule - Inherited

Instance Attribute Summary

ParameterRule - Inherited

Rule - Inherited

#cop_rule?

Does this rule relate to cops?

#parameter_rule?

Does this rule relate to parameters?

#violated?, #config

Instance Method Summary

ParameterRule - Inherited

Rule - Inherited

Instance Attribute Details

#violated?Boolean (readonly)

[ GitHub ]

  
# File 'lib/rubocop/config_obsoletion/changed_enforced_styles.rb', line 10

def violated?
  super && config[cop][parameter] == value
end

Instance Method Details

#message

[ GitHub ]

  
# File 'lib/rubocop/config_obsoletion/changed_enforced_styles.rb', line 14

def message
  base = format(BASE_MESSAGE,
                parameter: parameter, value: value, cop: cop, path: smart_loaded_path)

  if alternative
    "#{base}\n`#{parameter}: #{value}` has been renamed to " \
      "`#{parameter}: #{alternative.chomp}`."
  else
    "#{base}\n#{reason.chomp}"
  end
end

#value (private)

[ GitHub ]

  
# File 'lib/rubocop/config_obsoletion/changed_enforced_styles.rb', line 28

def value
  ['value']
end