module Singleton::SingletonInstanceMethods
Публичные методы экземпляра
# File lib/singleton.rb, line 109 def _dump(depth = -1) '' end
По умолчанию при сериализации не сохраняет состояние.
# File lib/singleton.rb, line 99
def clone
raise TypeError, "can't clone instance of singleton #{self.class}"
end Вызывает исключение TypeError, чтобы предотвратить клонирование.
# File lib/singleton.rb, line 104
def dup
raise TypeError, "can't dup instance of singleton #{self.class}"
end Вызывает исключение TypeError, чтобы предотвратить создание дубликата.
Ruby Core © 1993–2025 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.