module Singleton::SingletonClassProperties - Documentation for Ruby 3.4
Description: Documentation for the Singleton::SingletonClassProperties module
Keywords: ruby,module,Singleton::SingletonClassProperties

# module Singleton::SingletonClassProperties

### Public Class Methods

extended (c)
Source

    # File lib/singleton.rb, line 157
    def self.extended(c)
      # extending an object with Singleton is a bad idea
      c.singleton_class.send(:undef_method, :extend_object)
    end

included (c)
Source

    # File lib/singleton.rb, line 152
    def self.included(c)
      # extending an object with Singleton is a bad idea
      c.undef_method :extend_object
    end

### Private Instance Methods

append_features (mod)
Source

    # File lib/singleton.rb, line 172
    def append_features(mod)
      #  help out people counting on transitive mixins
      unless mod.instance_of?(Class)
        raise TypeError, "Inclusion of the OO-Singleton module in module #{mod}"
      end
      super
    end

Calls superclass method
included (klass)
Source

    # File lib/singleton.rb, line 180
    def included(klass)
      super
      klass.private_class_method :new, :allocate
      klass.extend module_with_class_methods
      Singleton.__init__(klass)
    end

Calls superclass method