each(...)
public
See <a href="/ruby/IO/each">IO#each</a>.
Show source
/*
* call-seq:
* strio.each(sep_string=$/) {|line| block } -> strio
* strio.each_line(sep_string=$/) {|line| block } -> strio
*
* See IO
*/
static VALUE
strio_each(argc, argv, self)
int argc;
VALUE *argv;
VALUE self;
{
struct StringIO *ptr = StringIO(self);
VALUE line;
while (!NIL_P(line = strio_getline(argc, argv, readable(ptr)))) {
rb_yield(line);
}
return self;
}