Module: IO::readable
- Included in:
- StringIO
- Defined in:
- stringio.c
Instance Method Summary collapse
-
#sysread(integer[, outbuf]) ⇒ String
Similar to #read, but raises
EOFError
at end of string instead of returningnil
, as well as IO#sysread does. -
#readbyte ⇒ Fixnum
See IO#readbyte.
-
#readchar ⇒ String
See IO#readchar.
-
#readline ⇒ Object
See IO#readline.
-
#sysread(integer[, outbuf]) ⇒ String
Similar to #read, but raises
EOFError
at end of string instead of returningnil
, as well as IO#sysread does. -
#sysread(integer[, outbuf]) ⇒ String
Similar to #read, but raises
EOFError
at end of string instead of returningnil
, as well as IO#sysread does.
Instance Method Details
#sysread(integer[, outbuf]) ⇒ String
Similar to #read, but raises EOFError
at end of string instead of returning nil
, as well as IO#sysread does.
1338 1339 1340 1341 1342 1343 1344 1345 1346 |
# File 'stringio.c', line 1338
static VALUE
strio_sysread(int argc, VALUE *argv, VALUE self)
{
VALUE val = rb_funcall2(self, rb_intern("read"), argc, argv);
if (NIL_P(val)) {
rb_eof_error();
}
return val;
}
|
#readbyte ⇒ Fixnum
See IO#readbyte.
844 845 846 847 848 849 850 |
# File 'stringio.c', line 844
static VALUE
strio_readbyte(VALUE self)
{
VALUE c = rb_funcall2(self, rb_intern("getbyte"), 0, 0);
if (NIL_P(c)) rb_eof_error();
return c;
}
|
#readchar ⇒ String
See IO#readchar.
830 831 832 833 834 835 836 |
# File 'stringio.c', line 830
static VALUE
strio_readchar(VALUE self)
{
VALUE c = rb_funcall2(self, rb_intern("getc"), 0, 0);
if (NIL_P(c)) rb_eof_error();
return c;
}
|
#readline(sep = $/) ⇒ String #readline(limit) ⇒ String? #readline(sep, limit) ⇒ String?
See IO#readline.
1079 1080 1081 1082 1083 1084 1085 |
# File 'stringio.c', line 1079
static VALUE
strio_readline(int argc, VALUE *argv, VALUE self)
{
VALUE line = rb_funcall2(self, rb_intern("gets"), argc, argv);
if (NIL_P(line)) rb_eof_error();
return line;
}
|
#sysread(integer[, outbuf]) ⇒ String
Similar to #read, but raises EOFError
at end of string instead of returning nil
, as well as IO#sysread does.
1338 1339 1340 1341 1342 1343 1344 1345 1346 |
# File 'stringio.c', line 1338
static VALUE
strio_sysread(int argc, VALUE *argv, VALUE self)
{
VALUE val = rb_funcall2(self, rb_intern("read"), argc, argv);
if (NIL_P(val)) {
rb_eof_error();
}
return val;
}
|
#sysread(integer[, outbuf]) ⇒ String
Similar to #read, but raises EOFError
at end of string instead of returning nil
, as well as IO#sysread does.
1338 1339 1340 1341 1342 1343 1344 1345 1346 |
# File 'stringio.c', line 1338
static VALUE
strio_sysread(int argc, VALUE *argv, VALUE self)
{
VALUE val = rb_funcall2(self, rb_intern("read"), argc, argv);
if (NIL_P(val)) {
rb_eof_error();
}
return val;
}
|