Ruby

Ruby

Made by DeepSource

Ineffective access modifier detected RB-LI1028

Anti-pattern
Major

private or protected access modifiers which are applied to a singleton method do not make them private/protected. private_class_method can be used for that.

Bad practice

class C
  private

  def self.method
    puts 'hi'
  end
end

Recommended

class C
  def self.method
    puts 'hi'
  end

  private_class_method :method
end