Module: Dry::Monads::Do::All::InstanceMixin Private

Included in:
Dry::Monads::Do::All
Defined in:
lib/dry/monads/do/all.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#extended(object) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/dry/monads/do/all.rb', line 113

def extended(object)
  super

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

    next if method.equal?(:singleton_method_added)
    Do.wrap_method(wrapper, method)
  end
  object.singleton_class.instance_methods(false).each do |m|
    Do.wrap_method(wrapper, m)
  end
end