- Make sure you have a correct Ruby version installed. See .ruby-version for an up-to-date info.
- Download this repo:
git clone git@github.com:Morozzzko/bowling.git
- Navigate to the downloaded directory:
cd bowling
- Run
bundle install
to install dependencies - Run
bundle exec rake db:migrate
to run migrations - Run
bundle exec rackup
to run the server
- Perform steps 1-4 of "Install" section
- Run
RACK_ENV=test bundle exec rake db:migrate
to create test database - Run
bundle exec rspec
to run the tests
Create a new bowling game.
Required parameter: player_name
– name of the current player. Feel free to use aliases, nicknames or pet names.
Returns 422 on invalid input or 200 with Game composite on success
Get game info and score
Returns a JSON object with Game composite
Notify that a player has knocked down specific number of pins.
Required parameter: pins
– number of pins knocked down after a throw.
Returns 422 on invalid input or 200 with Game composite on success
It's an object which is returned from all of three API endpoints.
player_name
with a player nameuid
with a game UIDstate
indicates whether the game is currentlyplaying
orended
score
which is a hash with integer keys from 1 to 10, indicating score for each individual frame, and atotal
. Score for each individual frame is an object, too. It has two keys:balls
, which lists how many pins were knocked down by each ball, andscore
.
Example: