Ruby

Ruby

Made by DeepSource

Detected use of discouraged ways to define class methods RB-ST1194

Style
Major

Using def self.method_name or class << self to define class methods is recommended.

Bad practice

# bad
class SomeClass
  def self.class_method
    # ...
  end
end

Recommended

# good
class SomeClass
  class << self
    def class_method
      # ...
    end
  end
end