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