From: Derek Cannon Date: 2010-03-27T03:59:18+09:00 Subject: Re: Creating a gsub! method for Arrays Derek Cannon wrote: > class Array > def gsub!(pattern, replacement) > each { |x| > x.gsub!(pattern, replacement) > } > end > end Just out of curiosity, does anyone know how Ruby knows what "each" is referring to in this case? It works as intended -- I'm just curious as to HOW. -- Posted via http://www.ruby-forum.com/.