Klasse & lt; & lt; Selbst vs Selbst. Methode mit Ruby: Was ist besser?

Diese Ruby Style Guide sagt, dass ist besser mit self.method_name statt class method_name. Aber Warum?

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

Gibt es performance-Probleme?

InformationsquelleAutor der Frage Mich Dart | 2012-06-09

Schreibe einen Kommentar