module Dry::Monads::Do::All::InstanceMixin

@api private

Public Instance Methods

extended(object) click to toggle source

@api private

Calls superclass method
# File lib/dry/monads/do/all.rb, line 131
def extended(object)
  super

  wrapper = ::Module.new
  eigenclass = object.singleton_class
  eigenclass.prepend(wrapper)
  object.define_singleton_method(:singleton_method_added) do |method|
    super(method)

    next if method.equal?(:singleton_method_added)

    visibility = Do.method_visibility(eigenclass, method)
    Do.wrap_method(wrapper, method, visibility)
  end

  All.wrap_defined_methods(eigenclass, wrapper)
end