lib/game_shuffle_cards/validate_game.rb
# Validates whether the amount and type of players are right. Otherwise raise an exception
# @param players [String|Integer]
# @return number of players [Integer]
Validates whether the amount and type of players are right. Otherwise raise an exception
Validates whether the amount and type of players are right . Otherwise raise an exception
def parse_and_validate_players(players)
				begin
					players = Integer(players)
				rescue
					raise TypeError
				end
				raise GameShuffleCards::ToManyPlayersError if players > GameShuffleCards::Game::MAXIMUN_PLAYERS
				raise GameShuffleCards::NotEnoughPlayersError if players < GameShuffleCards::Game::MINIMUN_PLAYERS
				players
			end
def parse_and_validate_players ( players ) begin players = Integer ( players ) rescue raise TypeError end raise GameShuffleCards :: ToManyPlayersError if players > GameShuffleCards :: Game :: MAXIMUN_PLAYERS raise GameShuffleCards :: NotEnoughPlayersError if players < GameShuffleCards :: Game :: MINIMUN_PLAYERS players end
Validates whether the amount and type of players are right.
Validates whether the amount and type of players are right .
number of players
number of players
Integer
players
<not_specific>
<not_specific>
None