Woa! There is no Object just a Kernel

Object.instance_methods(false)
=>

Kernel.instance_methods(false)
=> ["==", "===", "=~", "__id__", "__send__", "class", "clone",
"display", "dup", "eql?", "equal?", "extend", "freeze", "frozen?",
"hash", "id", "inspect", "instance_eval", "instance_of?",
"instance_variable_get", "instance_variable_set", "instance_variables",
"is_a?", "kind_of?", "method", "methods", "nil?", "object_id",
"private_methods", "protected_methods", "public_methods", "require",
"require_gem", "require_gem_with_options", "respond_to?", "send",
"singleton_methods", "taint", "tainted?", "to_a", "to_s", "type",
"untaint"]

The documentation sure doesn't reflect this.

ri Object

...[snip]...

Includes:

ยทยทยท

---------
     Kernel(Array, Float, Integer, String, `, abort, at_exit, autoload,
     autoload?, binding, block_given?, callcc, caller, catch, chomp,
     chomp!, chop, chop!, eval, exec, exit, exit!, fail, fork, format,
     getc, gets, global_variables, gsub, gsub!, iterator?, lambda,
load,
     local_variables, loop, method_missing, open, p, print, printf,
     proc, putc, puts, raise, rand, readline, readlines, require, scan,
     select, set_trace_func, sleep, split, sprintf, srand, sub, sub!,
     syscall, system, test, throw, trace_var, trap, untrace_var, warn,
     y)

Class methods:
--------------
     new

Instance methods:
-----------------
     ==, ===, =~, __id__, __send__, class, clone, display, dup, eql?,
     equal?, extend, freeze, frozen?, hash, id, initialize_copy,
     inspect, instance_eval, instance_of?, instance_variable_get,
     instance_variable_set, instance_variables, is_a?, kind_of?,
method,
     methods, nil?, object_id, private_methods, protected_methods,
     public_methods, remove_instance_variable, respond_to?, send,
     singleton_method_added, singleton_method_removed,
     singleton_method_undefined, singleton_methods, taint, tainted?,
     to_a, to_s, type, untaint

So, I didn't realize that module_function would prevent the methods
from showing up in the instance_method list --effectively they are
present, arn't they?

T.

"Trans" wrote:

The documentation sure doesn't reflect this.

<PickAxe I and, I dare say, II - "Class Object">

  "Object mixes in the Kernel module, making the built-in
   kernel functions globally accessible. Although the
   instance methods of Object are defined by the Kernel
   module, we have chosen to document them here for clarity."

</>

daz

Thanks daz,

Yes, I recall reading that now. But I thought it was just the methods
listed under "Includes". I did not realize ALL the methods were coming
from Kernel. What's the point of that anyway? Moreover I still find it
annoying that the module_function methods are not listable as such. For
instance, how can I query the system to find out that #eval is a
module_function of Kernel included in Object?

Thanks,
T.