Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Module#private_instance_methods
mod.private_instance_methods(include_super=true) → array
object.c
View on GitHub ↗
VALUE
rb_class_private_instance_methods(int argc, const VALUE *argv, VALUE mod)
{
return class_instance_method_list(argc, argv, mod, 0, ins_methods_priv_i);
}
Returns a list of the private instance methods defined in mod. If the optional parameter is false, the methods of any ancestors are not included.
Example
module Mod def method1() end private :method1 def method2() end end Mod.instance_methods #=> [:method2] Mod.private_instance_methods #=> [:method1]
See also
#private_constant
#private_method_defined?
#private_class_method
#protected
also in
4.1 · 4.0 · 3.4 · 3.2 · 3.1 · 3.0