Module: IO::generic_readable

Defined in:
ext/io/console/console.c

Instance Method Summary collapse

Instance Method Details

#getch(min: nil, time: nil, intr: nil) ⇒ String

See IO#getch.

Returns:

  • (String)


1664
1665
1666
1667
1668
# File 'ext/io/console/console.c', line 1664

static VALUE
io_getch(int argc, VALUE *argv, VALUE io)
{
    return rb_funcallv(io, id_getc, argc, argv);
}

#getpass(prompt = nil) ⇒ String

See IO#getpass.

Returns:

  • (String)


1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
# File 'ext/io/console/console.c', line 1747

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);
}