@parthaa what ruby are you on? In 1.9.3, Enumerator includes Enumerable which has #flat_map:

http://www.ruby-doc.org/core-1.9.3/Enumerable.html#method-i-flat_map