123456789_123456789_123456789_123456789_123456789_

Class: RuboCop::ConfigObsoletion::Rule 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, RuboCop::ConfigObsoletion::CopRule, RuboCop::ConfigObsoletion::ExtractedCop, RuboCop::ConfigObsoletion::ParameterRule, RuboCop::ConfigObsoletion::RemovedCop, RuboCop::ConfigObsoletion::RenamedCop, RuboCop::ConfigObsoletion::SplitCop
Inherits: Object
Defined in: lib/rubocop/config_obsoletion/rule.rb

Overview

Abstract base class for ConfigObsoletion rules

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#config (readonly, private)

[ GitHub ]

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

attr_reader :config

#cop_rule?Boolean (readonly)

Does this rule relate to cops?

[ GitHub ]

  
# File 'lib/rubocop/config_obsoletion/rule.rb', line 13

def cop_rule?
  false
end

#parameter_rule?Boolean (readonly)

Does this rule relate to parameters?

[ GitHub ]

  
# File 'lib/rubocop/config_obsoletion/rule.rb', line 18

def parameter_rule?
  false
end

#violated?Boolean (readonly)

Raises:

  • (NotImplementedError)
[ GitHub ]

  
# File 'lib/rubocop/config_obsoletion/rule.rb', line 22

def violated?
  raise NotImplementedError
end

Instance Method Details

#smart_loaded_path (private)

[ GitHub ]

  
# File 'lib/rubocop/config_obsoletion/rule.rb', line 36

def smart_loaded_path
  PathUtil.smart_path(config.loaded_path)
end

#to_sentence(collection, connector: 'and') (private)

[ GitHub ]

  
# File 'lib/rubocop/config_obsoletion/rule.rb', line 30

def to_sentence(collection, connector: 'and')
  return collection.first if collection.size == 1

  [collection[0..-2].join(', '), collection[-1]].join(" #{connector} ")
end