123456789_123456789_123456789_123456789_123456789_

Class: IO::Console::Mode

Do not use. This class is for internal use only.
Relationships & Source Files
Inherits: Object
Defined in: ext/io/console/console.c

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#echo=(f) (writeonly)

[ GitHub ]

  
# File 'ext/io/console/console.c', line 765

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

#virtual_terminal_processing=(enabled) (rw)

Enables or disables virtual terminal sequence processing in mode. Assign mode to IO#console_mode= to apply the change.

[ GitHub ]

  
# File 'ext/io/console/console.c', line 818

static VALUE
conmode_set_virtual_terminal_processing(VALUE obj, VALUE enabled)
{
    conmode *t = rb_check_typeddata(obj, &conmode_type);
    if (RTEST(enabled))
	*t |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
    else
	*t &= ~ENABLE_VIRTUAL_TERMINAL_PROCESSING;
    return obj;
}

#virtual_terminal_processing?Boolean (rw)

Returns whether virtual terminal sequences are processed on output.

[ GitHub ]

  
# File 'ext/io/console/console.c', line 804

static VALUE
conmode_virtual_terminal_processing_p(VALUE obj)
{
    conmode *t = rb_check_typeddata(obj, &conmode_type);
    return (*t & ENABLE_VIRTUAL_TERMINAL_PROCESSING) ? Qtrue : Qfalse;
}

#wrap_at_eol_output=(enabled) (rw)

Enables or disables wrapping at the end of a line in mode. Assign mode to IO#console_mode= to apply the change.

[ GitHub ]

  
# File 'ext/io/console/console.c', line 849

static VALUE
conmode_set_wrap_at_eol_output(VALUE obj, VALUE enabled)
{
    conmode *t = rb_check_typeddata(obj, &conmode_type);
    if (RTEST(enabled))
	*t |= ENABLE_WRAP_AT_EOL_OUTPUT;
    else
	*t &= ~ENABLE_WRAP_AT_EOL_OUTPUT;
    return obj;
}

#wrap_at_eol_output?Boolean (rw)

Returns whether output wraps at the end of a line.

[ GitHub ]

  
# File 'ext/io/console/console.c', line 835

static VALUE
conmode_wrap_at_eol_output_p(VALUE obj)
{
    conmode *t = rb_check_typeddata(obj, &conmode_type);
    return (*t & ENABLE_WRAP_AT_EOL_OUTPUT) ? Qtrue : Qfalse;
}

Instance Method Details

#initialize_copy(obj2)

[ GitHub ]

  
# File 'ext/io/console/console.c', line 756

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)

[ GitHub ]

  
# File 'ext/io/console/console.c', line 786

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)

[ GitHub ]

  
# File 'ext/io/console/console.c', line 776

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