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
- .new(config) ⇒ Rule constructor Internal use only
Instance Attribute Summary
-
#cop_rule? ⇒ Boolean
readonly
Internal use only
Does this rule relate to cops?
-
#parameter_rule? ⇒ Boolean
readonly
Internal use only
Does this rule relate to parameters?
- #violated? ⇒ Boolean readonly Internal use only
- #config readonly private Internal use only
Instance Method Summary
- #smart_loaded_path private Internal use only
- #to_sentence(collection, connector: 'and') private Internal use only
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?
# File 'lib/rubocop/config_obsoletion/rule.rb', line 13
def cop_rule? false end
#parameter_rule? ⇒ Boolean
(readonly)
Does this rule relate to parameters?
# File 'lib/rubocop/config_obsoletion/rule.rb', line 18
def parameter_rule? false end
#violated? ⇒ Boolean
(readonly)
# 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