ineffective-access-modifier
What it does
Section titled “What it does”Reports private or protected before def self.name, which does not affect it. private_class_method :name in the class makes the method private on purpose and is not reported.
Why it matters
Section titled “Why it matters”private applies to instance methods only, so the singleton method stays public although it looks private.
To fix, use private_class_method, or open class << self and put the methods after private.
Example
Section titled “Example”... super end private def self.baz; end... def qux; end...Configuration
Section titled “Configuration”ruby: lint: rules: ineffective-access-modifier: warn # off, warn (default), errorEnabled by the presets: ruby/rubocop.
Suppress one line with sudsy-disable-next-line ineffective-access-modifier in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| rubocop | Lint/IneffectiveAccessModifier |
full |