<commit_before>#
# Class methods
#
# Ruby only support instance methods. The everyday class methods we use end up
# in the Singleton class.
class Foo

  def self.one () 1 end

  class << self
    def two () 2 end
  end

  def three () 3 end

  # self here is redundant
  self.singleton_methods # => ["two", "one"]
  self.class             # => Class
  self                   # => Foo
end

#
# Mocking and testing frameworks
class Foo
  def bar?<commit_msg>[singleton] Add another way to extend singleton classes<commit_after>#
# Class methods
#
# Ruby only support instance methods. The everyday class methods we use end up
# in the Singleton class.
class Foo

  def self.one () 1 end

  class << self
    def two () 2 end

    <<-DOC
      Inside the Foo's body self is Foo. So the above is the same as:

      class Foo; end
      class << Foo
        def two () 2 end
      end

      Or technically you could also just replace self with Foo inside the body,
      but this is not used usually.
    DOC
  end

  def three () 3 end

  # self here is redundant
  self.singleton_methods # => ["two", "one"]
  self.class             # => Class
  self                   # => Foo
end

#
# Mocking and testing frameworks
class Foo
  def bar?
{'fraction_non_alphanumeric': 0.07841552142279709, 'fraction_numerical': 0.005658852061438965, 'mean_word_length': 2.2323759791122715, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '948598', 'n_tokens_mistral': 389, 'n_tokens_neox': 346, 'n_words': 165}