core/module.rbs in rbs-3.3.2 vs core/module.rbs in rbs-3.4.0.pre.1
- old
+ new
@@ -1461,11 +1461,11 @@
# -->
# Refine *mod* in the receiver.
#
# Returns a module, where refined methods are defined.
#
- def refine: (Module mod) { () -> void } -> Refinement
+ def refine: (Module mod) { () [self: Refinement] -> void } -> Refinement
# <!--
# rdoc-file=eval.c
# - refinements -> array
# -->
@@ -1524,9 +1524,53 @@
# -->
# Removes the method identified by *symbol* from the current class. For an
# example, see Module#undef_method. String arguments are converted to symbols.
#
def remove_method: (*interned arg0) -> self
+
+ # <!--
+ # rdoc-file=object.c
+ # - mod.set_temporary_name(string) -> self
+ # - mod.set_temporary_name(nil) -> self
+ # -->
+ # Sets the temporary name of the module `mod`. This name is used as a prefix for
+ # the names of constants declared in `mod`. If the module is assigned a
+ # permanent name, the temporary name is discarded.
+ #
+ # After a permanent name is assigned, a temporary name can no longer be set, and
+ # this method raises a RuntimeError.
+ #
+ # If the name given is not a string or is a zero length string, this method
+ # raises an ArgumentError.
+ #
+ # The temporary name must not be a valid constant name, to avoid confusion with
+ # actual constants. If you attempt to set a temporary name that is a a valid
+ # constant name, this method raises an ArgumentError.
+ #
+ # If the given name is `nil`, the module becomes anonymous.
+ #
+ # Example:
+ #
+ # m = Module.new # => #<Module:0x0000000102c68f38>
+ # m.name #=> nil
+ #
+ # m.set_temporary_name("fake_name") # => fake_name
+ # m.name #=> "fake_name"
+ #
+ # m.set_temporary_name(nil) # => #<Module:0x0000000102c68f38>
+ # m.name #=> nil
+ #
+ # n = Module.new
+ # n.set_temporary_name("fake_name")
+ #
+ # n::M = m
+ # n::M.name #=> "fake_name::M"
+ # N = n
+ #
+ # N.name #=> "N"
+ # N::M.name #=> "N::M"
+ #
+ def set_temporary_name: (string?) -> self
# <!--
# rdoc-file=object.c
# - mod.singleton_class? -> true or false
# -->