Spec-Zone.ru › Ruby 3.4
  1. Singleton::
  2. SingletonClassProperties

module Singleton::SingletonClassProperties

Открытые методы класса

extended (c) Показать исходный код
# 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) Показать исходный код
# 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

Закрытые методы экземпляра

append_features (mod) Показать исходный код
# 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
Вызывает метод суперкласса
included (klass) Показать исходный код
# 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
Вызывает метод суперкласса

Ruby Core © 1993–2025 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API