Skip to content

End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

Module#method_added

method_added(method_name)

Invoked as a callback whenever an instance method is added to the receiver.

Example
module Chatty
  def self.method_added(method_name)
    puts "Adding #{method_name.inspect}"
  end
  def self.some_class_method() end
  def some_instance_method() end
end

produces:

Example
Adding :some_instance_method