Skip to content

Example Sinatra API running on Puma using DataMapper & Minitest.

Notifications You must be signed in to change notification settings

truenito/order-of-the-pixel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Order of the Pixel

General

Order of the Pixel is a small Sinatra API running on Puma using DataMapper & Minitest and it's open for people to play with it.

API Description

We enjoy role playing games here at Pixel Perfect Tree so we’ve developed a small API to list the heroes from the Order of Pixel. A Hero is composed of 3 basic entities, a Weapon, A Race and a Job.

  • The Weapon is what the hero will wear on his quests (ie: Bastard Sword or Mighty Bow).
  • The Race is a classification used to categorize heroes into distinct populations or groups by anatomical, cultural and geographical (ie: Elf, Dwarf or Orc).
  • The Job aggregates several abilities and aptitudes depending what role the hero has chosen to follow (ie: Warrior, Warlock, Priest or Archer)

API usage

Here are the url's supported by the API:

Note: This API only supports JSON.

Example Requests

Below is an example request that will create a Weapon.

{
    "name": "Mjolnir",
    "desc": "Thor's Hammer, he might smite as hard as he desires, whatsoever might be before him, and the hammer would not fail."
}

Here is an example request that will create a Race.

{
    "name": "God"
}

Here is an example request that will create a Job.

{
    "name": "Paladin"
}

Here is an example request that will create a Hero.

{
    "name": "Thor",
    "weapon_id": 1,
    "job_id": 1,
    "race_id": 1
}

Notes

  • At the moment, you can't delete a Weapon, Race or Job if it's currently assigned to a hero (But you can delete a hero without destroying it's attached entities).

  • Tests can be run using the Rake task rake test.

  • To run the Sinatra app simply install the dependencias via bundler and run the server from the root using ruby app.rb.

Destroy, update and show actions are available by specifiying the entity's ID at the end (ie: http://order-of-the-pixel.herokuapp.com/api/v1/weapons/1).

About

Example Sinatra API running on Puma using DataMapper & Minitest.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •