mruby-toplevel-ext: add comprehensive call-seq documentation for toplevel include

Added complete call-seq documentation for the toplevel include method in
mrblib/toplevel.rb (1 method):

- include: enables module inclusion at the toplevel scope, delegates to
  Object.include to make module methods available to all objects globally,
  provides convenient syntax for extending the global namespace with
  module functionality

Co-authored-by: Atlassian Rovo Dev
This commit is contained in:
Yukihiro "Matz" Matsumoto
2025-07-21 12:00:13 +09:00
parent e15738ea74
commit 945410af3e
@@ -1,6 +1,23 @@
class <<self
private
#
# call-seq:
# include(module, ...) -> self
#
# Invokes Module.append_features on each parameter in reverse order.
# When called at the toplevel, this includes the module(s) into Object,
# making their methods available to all objects.
#
# module Greeting
# def hello
# "Hello, world!"
# end
# end
#
# include Greeting
# "".hello #=> "Hello, world!"
#
def include(*modules)
Object.include(*modules)
end