Skip to content

Commit

Permalink
Generate docs with ruby 3.4.0-rc1
Browse files Browse the repository at this point in the history
  • Loading branch information
soutaro committed Dec 18, 2024
1 parent 0d29fc9 commit fad2968
Show file tree
Hide file tree
Showing 75 changed files with 6,202 additions and 4,013 deletions.
3,282 changes: 1,717 additions & 1,565 deletions core/array.rbs

Large diffs are not rendered by default.

73 changes: 38 additions & 35 deletions core/basic_object.rbs
Original file line number Diff line number Diff line change
@@ -1,49 +1,44 @@
# <!-- rdoc-file=object.c -->
# BasicObject is the parent class of all classes in Ruby. It's an explicit
# blank class.
# `BasicObject` is the parent class of all classes in Ruby. In particular,
# `BasicObject` is the parent class of class Object, which is itself the default
# parent class of every Ruby class:
#
# BasicObject can be used for creating object hierarchies independent of Ruby's
# object hierarchy, proxy objects like the Delegator class, or other uses where
# namespace pollution from Ruby's methods and classes must be avoided.
# class Foo; end
# Foo.superclass # => Object
# Object.superclass # => BasicObject
#
# To avoid polluting BasicObject for other users an appropriately named subclass
# of BasicObject should be created instead of directly modifying BasicObject:
# `BasicObject` is the only class that has no parent:
#
# class MyObjectSystem < BasicObject
# end
# BasicObject.superclass # => nil
#
# BasicObject does not include Kernel (for methods like `puts`) and BasicObject
# is outside of the namespace of the standard library so common classes will not
# be found without using a full class path.
# Class `BasicObject` can be used to create an object hierarchy (e.g., class
# Delegator) that is independent of Ruby's object hierarchy. Such objects:
#
# A variety of strategies can be used to provide useful portions of the standard
# library to subclasses of BasicObject. A subclass could `include Kernel` to
# obtain `puts`, `exit`, etc. A custom Kernel-like module could be created and
# included or delegation can be used via #method_missing:
# * Do not have namespace "pollution" from the many methods provided in class
# Object and its included module Kernel.
# * Do not have definitions of common classes, and so references to such
# common classes must be fully qualified (`::String`, not `String`).
#
# class MyObjectSystem < BasicObject
# DELEGATE = [:puts, :p]
# A variety of strategies can be used to provide useful portions of the Standard
# Library in subclasses of `BasicObject`:
#
# def method_missing(name, *args, &block)
# return super unless DELEGATE.include? name
# ::Kernel.send(name, *args, &block)
# end
# * The immediate subclass could `include Kernel`, which would define methods
# such as `puts`, `exit`, etc.
# * A custom Kernel-like module could be created and included.
# * Delegation can be used via #method_missing:
#
# def respond_to_missing?(name, include_private = false)
# DELEGATE.include?(name) or super
# end
# end
# class MyObjectSystem < BasicObject
# DELEGATE = [:puts, :p]
#
# Access to classes and modules from the Ruby standard library can be obtained
# in a BasicObject subclass by referencing the desired constant from the root
# like `::File` or `::Enumerator`. Like #method_missing, #const_missing can be
# used to delegate constant lookup to `Object`:
# def method_missing(name, *args, &block)
# return super unless DELEGATE.include? name
# ::Kernel.send(name, *args, &block)
# end
#
# class MyObjectSystem < BasicObject
# def self.const_missing(name)
# ::Object.const_get(name)
# end
# end
# def respond_to_missing?(name, include_private = false)
# DELEGATE.include?(name)
# end
# end
#
# ### What's Here
#
Expand All @@ -60,6 +55,14 @@
# `self`.
# * #instance_exec: Executes the given block in the context of `self`, passing
# the given arguments.
# * #method_missing: Called when `self` is called with a method it does not
# define.
# * #singleton_method_added: Called when a singleton method is added to
# `self`.
# * #singleton_method_removed: Called when a singleton method is removed from
# `self`.
# * #singleton_method_undefined: Called when a singleton method is undefined
# in `self`.
#
class BasicObject
# <!--
Expand Down
2 changes: 1 addition & 1 deletion core/comparable.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#
# ## What's Here
#
# Module Comparable provides these methods, all of which use method `<=>`:
# Module Comparable provides these methods, all of which use method `#<=>`:
#
# * #<: Returns whether `self` is less than the given object.
# * #<=: Returns whether `self` is less than or equal to the given object.
Expand Down
Loading

0 comments on commit fad2968

Please sign in to comment.