class Module

Public Class Methods

singleton_method_added(_method) click to toggle source
# File lib/domesticate_monkeys/initializers/module.rb, line 24
def self.singleton_method_added(_method)
  unbound_method = self.method(_method)
  DomesticateMonkeys::Track.add(unbound_method, :singleton)
end

Public Instance Methods

method_added(_method) click to toggle source

Although ‘the earlier, the better’ does definitely apply, this should, in any case, happen BEFORE the initialization of Rails and all other gems. The reason being that we can only track redefinitions of methods defined in gems, such as Rails, if we first are able to built a Track for that method’s orignal definition.

# File lib/domesticate_monkeys/initializers/module.rb, line 19
def method_added(_method)
  unbound_method = self.instance_method(_method)
  DomesticateMonkeys::Track.add(unbound_method, :instance)
end