class Foo
def initialize
@obj = true
if block_given?
yield
end
end
end
class Bar < Foo
def initialize
@obj = false
if block_given?
yield self
end
super
end
end
f = nil
obj = Bar.new { |x|
f ||= x
if x.nil? && !f.nil?
f.instance_variable_set(:@obj, false)
end
}
p obj