From: Mark T Date: 2006-03-29T00:53:55+09:00 Subject: Re: Duck typing bunches of strings On Tue, 28 Mar 2006 03:33:12 +0900, Logan Capaldo wrote: > Just curious, but what happens if you just throw a string at it? > str.each { |s| } tends to be str most of the time anyway. From the docs: Splits _str_ using the supplied parameter as the record separator (+$/+ by default), passing each substring in turn to the supplied block. If a zero-length record separator is supplied, the string is split on +\n+ characters, except that multiple successive newlines are appended together. String#each is actually the same as String#each_line (one is aliased to the other). To the OP: why do you want to exclude String? Shouldn't you allow your user to consider a string as a collection of lines? That way, someone using your library to work on data from a newline-separated file doesn't have to parse it themselves, just load it into a String and call your method on it. Mark T