Module: Enumerable

Defined in:
lib/term/redio.rb,
lib/term/checkbox.rb

Overview

Author:

Instance Method Summary collapse

Instance Method Details

#checkboxArray

the checkbox widget.

A checkbox allows a user to select same value from Enumerable.

Examples:

['a', 'b', 7].checkbox

Returns:

  • (Array)

    the selected of values



14
15
16
17
18
19
20
21
# File 'lib/term/checkbox.rb', line 14

def checkbox
  size.times { print $/ }
  @begin_pos = IO.up(size).hide.pos
  @checkbox_res = []
  process_input_checkbox
  IO.show
  @checkbox_res
end

#redioObject

the redio Component.

Examples:

redio

['a', 'b', 7].redio

Returns:

  • (Object)

    the redio val



13
14
15
16
17
18
19
# File 'lib/term/redio.rb', line 13

def redio
  size.times { print $/ }
  @begin_pos = IO.up(size).hide.pos
  process_input_redio
  IO.show
  @redio_res
end