Skip to content

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

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]