Temporary execution context with included modules
1 2 def foo 3 'bar' 4 end 5 6 module M 7 def foo 8 'baz' 9 end 10 end 11 12 puts "should be 'bar': #{foo}" 13 14 self.dup.instance_eval do 15 extend(M) 16 puts "should be 'baz': #{foo}" 17 end 18 19 puts "should be 'bar': #{foo}"