Module: IO::generic_readable

Defined in:
console/console.c

Instance Method Summary collapse

Instance Method Details

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

See IO#getch.

Returns:

  • (String)

844
845
846
847
848
# File 'console/console.c', line 844

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

#getpass(prompt = nil) ⇒ String

See IO#getpass.

Returns:

  • (String)

911
912
913
914
915
916
917
918
919
920
921
# File 'console/console.c', line 911

static VALUE
io_getpass(int argc, VALUE *argv, VALUE io)
{
    VALUE str;

    rb_check_arity(argc, 0, 1);
    prompt(argc, argv, io);
    str = str_chomp(rb_funcallv(io, id_gets, 0, 0));
    puts_call(io);
    return str;
}