module T::Private::Methods
def self._hook_impl(target, singleton_class, source)
the module target is adding the methods from the module source to itself. we need to check that for all instance
def self._hook_impl(target, singleton_class, source) # we do not need to call add_was_ever_final here, because we have already marked # any such methods when source was originally defined. if !@modules_with_final.include?(target.object_id) if !@modules_with_final.include?(source.object_id) return end note_module_deals_with_final(target) install_hooks(target) return end methods = source.instance_methods methods.select! do |method_name| @was_ever_final_names.include?(method_name) end if methods.empty? return end target_ancestors = singleton_class ? target.singleton_class.ancestors : target.ancestors _check_final_ancestors(target, target_ancestors, methods, source) end