class A
def initialize *a, &b
return if !b
m = singleton_class.class_eval do
define_method :cloaker_, &b
meth = instance_method :cloaker_
remove_method :cloaker_
meth
end
m.bind(self).call(*a)
end
def miao
p 42
end
end
module B
y = 24 #<- y is in B
A.new 33 do |z|
miao
p y, z
end
end