module IO::generic_readable
Public Instance Methods
getch(min: nil, time: nil, intr: nil) → char
click to toggle source
See IO#getch.
static VALUE
io_getch(int argc, VALUE *argv, VALUE io)
{
return rb_funcallv(io, id_getc, argc, argv);
}
getpass(prompt=nil) → string
click to toggle source
See IO#getpass.
static VALUE
io_getpass(int argc, VALUE *argv, VALUE io)
{
VALUE str;
rb_check_arity(argc, 0, 1);
prompt(argc, argv, io);
rb_check_funcall(io, id_flush, 0, 0);
str = rb_ensure(gets_call, io, puts_call, io);
return str_chomp(str);
}