method
inspect
v1_9_1_378 -
Show latest stable
- Class:
IO
inspect()public
Return a string describing this IO object.
static VALUE
rb_io_inspect(VALUE obj)
{
rb_io_t *fptr;
const char *cname;
const char *st = "";
fptr = RFILE(rb_io_taint_check(obj))->fptr;
if (!fptr || NIL_P(fptr->pathv)) return rb_any_to_s(obj);
cname = rb_obj_classname(obj);
if (fptr->fd < 0) {
st = " (closed)";
}
return rb_sprintf("#<%s:%s%s>", cname, RSTRING_PTR(fptr->pathv), st);
} Related methods
- Instance methods
- <<
- binmode
- binmode?
- bytes
- chars
- close
- close_on_exec=
- close_on_exec?
- close_read
- close_write
- closed?
- each
- each_byte
- each_char
- each_line
- eof
- eof?
- expect
- external_encoding
- fcntl
- fileno
- flush
- fsync
- getbyte
- getc
- gets
- initialize_copy
- inspect
- internal_encoding
- ioctl
- isatty
- lineno
- lineno=
- lines
- nonblock
- nonblock=
- nonblock?
- pid
- pos
- pos=
- printf
- putc
- puts
- read
- read_nonblock
- readbyte
- readchar
- readline
- readlines
- readpartial
- ready?
- reopen
- rewind
- scanf
- seek
- set_encoding
- stat
- sync
- sync=
- sysread
- sysseek
- syswrite
- tell
- to_i
- to_io
- tty?
- ungetbyte
- ungetc
- wait
- write
- write_nonblock
- Class methods
- binread
- copy_stream
- for_fd
- foreach
- new
- open
- pipe
- popen
- read
- readlines
- select
- sysopen
- try_convert
- Private methods
-
block_scanf -
soak_up_spaces