private_instance_methods is a Ruby Module method for inspecting the private instance methods available through a class or module. Called without an argument, it returns an array that includes methods defined there and methods inherited from ancestor classes or modules. section 5.4.2 section 15.2.3
Use the method-listing family to choose the visibility and scope you want to inspect:
- Call MyClass.private_instance_methods to list private instance methods available from MyClass, including inherited and included methods. section 15.2.3
- Pass false to restrict the result to private instance methods defined directly in the queried class or module. section 15.2.3
- Compare private_instance_methods with public_instance_methods, protected_instance_methods, and instance_methods when investigating method visibility. section 7.7.3 section 15.2.3
Inspecting Kernel’s private toolkit
Run `$ ruby -e 'p Kernel.private_instance_methods.sort'` to print a sorted list of Kernel’s private instance methods. The result includes scripting and general-purpose operations such as require, load, and raise; because Object mixes in Kernel, these methods can be called without an explicit receiver. section 5.4.2
Browse the related class- and object-level method-querying methods, including private_instance_methods, public_instance_methods, protected_instance_methods, and their object-level counterparts. section 15.2.3
