class << self vs self.method с Ruby: что лучше?

этоRuby Style Guide говорит, что лучше использоватьself.method_name вместоclass method_name, Но почему?

class TestClass
  # bad
  class << self
    def first_method
      # body omitted
    end

    def second_method_etc
      # body omitted
    end
  end

  # good
  def self.first_method
    # body omitted
  end

  def self.second_method_etc
    # body omitted
  end
end

Есть ли проблемы с производительностью?

Ответы на вопрос(6)

Ваш ответ на вопрос