Class: Utils::Terminal

Inherits:
Object
  • Object
show all
Defined in:
lib/tic_tac_toe/utils/terminal.rb

Class Method Summary collapse

Class Method Details

.clear_screenObject



4
5
6
# File 'lib/tic_tac_toe/utils/terminal.rb', line 4

def clear_screen
  system('clear') || system('cls')
end

.get_inputObject



8
9
10
11
12
# File 'lib/tic_tac_toe/utils/terminal.rb', line 8

def get_input
  val = gets.chomp

  val
end

.get_integer_inputObject



14
15
16
# File 'lib/tic_tac_toe/utils/terminal.rb', line 14

def get_integer_input
  get_input.to_i
end