From 945410af3e13cb11b89b1dfeaec7ad4925e70ade Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Mon, 21 Jul 2025 12:00:13 +0900 Subject: [PATCH] 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 --- mrbgems/mruby-toplevel-ext/mrblib/toplevel.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/mrbgems/mruby-toplevel-ext/mrblib/toplevel.rb b/mrbgems/mruby-toplevel-ext/mrblib/toplevel.rb index e5fc6239f..688d78afe 100644 --- a/mrbgems/mruby-toplevel-ext/mrblib/toplevel.rb +++ b/mrbgems/mruby-toplevel-ext/mrblib/toplevel.rb @@ -1,6 +1,23 @@ class < 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