class BetweenTheSheets::Wager

Public Class Methods

get(credits, pot) click to toggle source
# File lib/between_the_sheets/wager.rb, line 3
def self.get(credits, pot)
  loop do
    input = Ask.print "What's your wager? ", to_int: true

    if input > pot
      puts "Invalid amount. You can't bet more than the pot (#{pot})"
      next
    end

    break input if input > 0 && input <= credits
    puts "Invalid amount. You have #{credits} credits."
  end
end