Here is the sample code:

module SomeModule
	require 'set'
	class InModule
		include Enumerable
		def initialize
			@index=0
		end
		def each
			if @index == 10
				@index=0
			else
				yield @index
			end
		end
	end
end

class OutModule
	include Enumerable
	def initialize
		@index=0
	end
	def each
		if @index == 10
			@index=0
		else
			yield @index
		end
	end
end

in_module = SomeModule::InModule.new
out_module = OutModule.new
in_module_set = in_module.to_set
p in_module_set
# should raise NoMethodError exception
out_module_set = out_module.to_set
p out_module_set

#<Set: {0}>
#<Set: {0}>

The fact is that it would be more adequate to have Enumerable modified 
in SomeModule only. This case is simple, but we can imagine more vicious 
sample codes, with some method redefined => it will affect the whole 
program! This is a problem, isn't it?

What do you think about this?

Lio