Sha256: 909c8d60279ea5787d13ee2f8bdcf9b4cc1feafb7415fbadbd18e3a5c05c908b

Contents?: true

Size: 418 Bytes

Versions: 1

Compression:

Stored size: 418 Bytes

Contents

module Mathy
  class Verification
    def initialize(console)
      @console = console
    end

    def check_answer(question, correct_answer)
      @console.report ""
      @console.report question
      answer = gets
      if answer.to_i == correct_answer
        @console.report "Correct!"
        return true
      end
      @console.report "The correct answer is #{correct_answer}."
      false
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mathy-0.0.2 lib/mathy/verification.rb