Class: IO::ConsoleMode

Inherits:
Object
  • Object
show all
Defined in:
ext/io/console/console.c

Constant Summary collapse

VERSION =
rb_obj_freeze(rb_str_new_cstr(IO_CONSOLE_VERSION))

Instance Method Summary collapse

Instance Method Details

#echo=(f) ⇒ Object



733
734
735
736
737
738
739
740
741
742
# File 'ext/io/console/console.c', line 733

static VALUE
conmode_set_echo(VALUE obj, VALUE f)
{
    conmode *t = rb_check_typeddata(obj, &conmode_type);
    if (RTEST(f))
	set_echo(t, NULL);
    else
	set_noecho(t, NULL);
    return obj;
}

#initialize_copy(obj2) ⇒ Object



724
725
726
727
728
729
730
731
# File 'ext/io/console/console.c', line 724

static VALUE
conmode_init_copy(VALUE obj, VALUE obj2)
{
    conmode *t = rb_check_typeddata(obj, &conmode_type);
    conmode *t2 = rb_check_typeddata(obj2, &conmode_type);
    *t = *t2;
    return obj;
}

#raw(*args) ⇒ Object



754
755
756
757
758
759
760
761
762
763
# File 'ext/io/console/console.c', line 754

static VALUE
conmode_raw_new(int argc, VALUE *argv, VALUE obj)
{
    conmode *r = rb_check_typeddata(obj, &conmode_type);
    conmode t = *r;
    rawmode_arg_t opts, *optp = rawmode_opt(&argc, argv, 0, 0, &opts);

    set_rawmode(&t, optp);
    return conmode_new(rb_obj_class(obj), &t);
}

#raw!(*args) ⇒ Object



744
745
746
747
748
749
750
751
752
# File 'ext/io/console/console.c', line 744

static VALUE
conmode_set_raw(int argc, VALUE *argv, VALUE obj)
{
    conmode *t = rb_check_typeddata(obj, &conmode_type);
    rawmode_arg_t opts, *optp = rawmode_opt(&argc, argv, 0, 0, &opts);

    set_rawmode(t, optp);
    return obj;
}