method
each_line
v1_8_7_72 -
Show latest stable
- Class:
StringIO
each_line(...)public
See IO#each.
/*
* call-seq:
* strio.each(sep_string=$/) {|line| block } -> strio
* strio.each_line(sep_string=$/) {|line| block } -> strio
*
* See IO#each.
*/
static VALUE
strio_each(argc, argv, self)
int argc;
VALUE *argv;
VALUE self;
{
struct StringIO *ptr = StringIO(self);
VALUE line;
RETURN_ENUMERATOR(self, argc, argv);
while (!NIL_P(line = strio_getline(argc, argv, readable(ptr)))) {
rb_yield(line);
}
return self;
} Related methods
- Instance methods
- <<
- binmode
- bytes
- chars
- close
- close_read
- close_write
- closed?
- closed_read?
- closed_write?
- each
- each_byte
- each_char
- each_line
- eof
- eof
- eof?
- eof?
- fcntl
- fileno
- flush
- fsync
- getbyte
- getc
- gets
- initialize_copy
- isatty
- length
- lineno
- lineno=
- lines
- path
- pid
- pos
- pos
- pos=
- printf
- putc
- puts
- read
- readbyte
- readchar
- readline
- readline
- readlines
- reopen
- rewind
- rewind
- seek
- seek
- size
- string
- string=
- sync
- sync=
- sysread
- syswrite
- tell
- truncate
- tty?
- ungetc
- write
- Class methods
- new
- new
- open