Class: TTT::IOTerminal

Inherits:
Object
  • Object
show all
Defined in:
lib/tictactoe/io_terminal.rb

Instance Method Summary collapse

Instance Method Details

#present(prompt) ⇒ Object



3
4
5
# File 'lib/tictactoe/io_terminal.rb', line 3

def present(prompt)
  print prompt
end

#present_with_new_line(prompt) ⇒ Object



7
8
9
# File 'lib/tictactoe/io_terminal.rb', line 7

def present_with_new_line(prompt)
  puts prompt
end

#receiveObject



11
12
13
14
15
16
17
18
# File 'lib/tictactoe/io_terminal.rb', line 11

def receive
  result = gets.chomp
  if is_int?(result)
    return result.to_i
  else
    return result.chomp
  end
end