Class: Hemlock::Turn
- Inherits:
-
Object
- Object
- Hemlock::Turn
- Defined in:
- lib/hemlock/turn.rb
Instance Method Summary collapse
-
#initialize(flashcard) ⇒ Turn
constructor
A new instance of Turn.
- #take_turn ⇒ Object
Constructor Details
#initialize(flashcard) ⇒ Turn
Returns a new instance of Turn.
7 8 9 |
# File 'lib/hemlock/turn.rb', line 7 def initialize(flashcard) @flashcard = flashcard end |
Instance Method Details
#take_turn ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/hemlock/turn.rb', line 11 def take_turn puts @flashcard.question guess = Readline.readline('>> ', false) if @flashcard.correct?(guess) puts Rainbow('Correct').green else puts Rainbow('You must submit to the quarries').red punishment end end |