class View

require_relative ‘../controllers/game.rb’

Public Class Methods

correct_answer() click to toggle source
# File lib/UI.rb, line 22
def correct_answer
  render("Correct!")
end
game_intro() click to toggle source
# File lib/UI.rb, line 26
def game_intro
  render("Welcome to flashcards! Type your input for each question and lets start learning! To exit, type 'exit'")
end
render(text) click to toggle source
# File lib/UI.rb, line 7
def render(text)
  puts text
end
show_answer(card) click to toggle source
# File lib/UI.rb, line 14
def show_answer(card)
  render ("The correct answer is: '#{card.answer}'")
end
show_question(card) click to toggle source
# File lib/UI.rb, line 11
def show_question(card)      render card.question
end
wrong_answer() click to toggle source
# File lib/UI.rb, line 18
def wrong_answer
  render("Wrong answer! Wanna try again? (y/n)")
end