stdlib/singleton/0/singleton.rbs in rbs-2.0.0 vs stdlib/singleton/0/singleton.rbs in rbs-2.1.0
- old
+ new
@@ -1,5 +1,6 @@
+# <!-- rdoc-file=lib/singleton.rb -->
# The Singleton module implements the Singleton pattern.
#
# ## Usage
#
# To use Singleton, include the module in your class.
@@ -86,24 +87,43 @@
# a.strip = nil
# b = Marshal.load(stored_state)
# p a == b # => true
# p a.keep # => "keep this"
# p a.strip # => nil
+#
module Singleton
def self.__init__: (Class klass) -> Class
+ # <!--
+ # rdoc-file=lib/singleton.rb
+ # - instance()
+ # -->
+ # Returns the singleton instance.
+ #
def self.instance: () -> instance
public
+ # <!--
+ # rdoc-file=lib/singleton.rb
+ # - _dump(depth = -1)
+ # -->
# By default, do not retain any state when marshalling.
#
def _dump: (?Integer depth) -> String
+ # <!--
+ # rdoc-file=lib/singleton.rb
+ # - clone()
+ # -->
# Raises a TypeError to prevent cloning.
#
def clone: () -> bot
+ # <!--
+ # rdoc-file=lib/singleton.rb
+ # - dup()
+ # -->
# Raises a TypeError to prevent duping.
#
def dup: () -> bot
end