Module: TTY::Prompt::Symbols

Included in:
List, Slider
Defined in:
lib/tty/prompt/symbols.rb

Overview

Cross platform common Unicode symbols.

Constant Summary collapse

KEYS =
{
  tick: '',
  cross: '',
  star: '',
  dot: '',
  pointer: '',
  line: '',
  pipe: '|',
  handle: 'O',
  ellipsis: '',
  radio_on: '',
  radio_off: '',
  checkbox_on: '',
  checkbox_off: '',
  circle_on: '',
  circle_off: ''
}.freeze
WIN_KEYS =
{
  tick: '',
  cross: '×',
  star: '*',
  dot: '.',
  pointer: '>',
  line: '-',
  pipe: '|',
  handle: 'O',
  ellipsis: '...',
  radio_on: '(*)',
  radio_off: '( )',
  checkbox_on: '[×]',
  checkbox_off: '[ ]',
  circle_on: '(x)',
  circle_off: '( )'
}.freeze

Class Method Summary collapse

Class Method Details

.symbolsObject



45
46
47
# File 'lib/tty/prompt/symbols.rb', line 45

def symbols
  @symbols ||= windows? ? WIN_KEYS : KEYS
end

.windows?Boolean

Check if Windowz

Returns:

  • (Boolean)


55
56
57
# File 'lib/tty/prompt/symbols.rb', line 55

def windows?
  ::File::ALT_SEPARATOR == "\\"
end