Class: IO

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Instance Method Details

#echoObject



78
79
80
81
82
83
84
85
86
87
88
89
# File 'ext/noecho.c', line 78

static VALUE
console_echo(VALUE io) {
  int fd = get_fd(io);
  conmode t;

  if (!getattr(fd, &t))
    rb_raise(rb_eIOError, "Can't get attributes");

  set_echo(&t);
  setattr(fd, &t);
  return io;
}

#echo=(f) ⇒ Object



102
103
104
105
106
107
108
109
110
# File 'ext/noecho.c', line 102

static VALUE
console_set_echo(VALUE io, VALUE f) {
  if (RTEST(f))
    console_echo(io);
  else
    console_noecho(io);

  return io;
}

#echo?Boolean

Returns:

  • (Boolean)


91
92
93
94
95
96
97
98
99
100
# File 'ext/noecho.c', line 91

static VALUE
console_echo_p(VALUE io) {
  int fd = get_fd(io);
  conmode t;

  if (!getattr(fd, &t))
    rb_raise(rb_eIOError, "Can't get attributes");

  return echo_p(&t) ? Qtrue : Qfalse;
}

#noechoObject



65
66
67
68
69
70
71
72
73
74
75
76
# File 'ext/noecho.c', line 65

static VALUE
console_noecho(VALUE io) {
  int fd = get_fd(io);
  conmode t;

  if (!getattr(fd, &t))
    rb_raise(rb_eIOError, "Can't get attributes");

  set_noecho(&t);
  setattr(fd, &t);
  return io;
}