A Ruby interface to SWAPI (the Star Wars API).
Add this line to your application's Gemfile:
gem 'tatooine'
And then execute:
$ bundle
Or install it yourself as:
$ gem install tatooine
There are 6 resources available: Planets, Starships, Vehicles, People, Films and Species. They all have a similar interface.
planets = Tatooine::Planet.list
Tatooine::Planet.count
# => 60
planets.length
# => 10 # resources are paginated
planets.concat Tatooine::Planet.next
planets.length
# => 20
tatooine = Tatooine::Planet.get(1)
tatooine.name
# => "Tatooine"
tatooine.residents
# => [<Tatooine::Person>, ...]
tatooine.residents.first.name
# => "Luke Skywalker" # Will make the request to get the resourceIn SWAPI the objects are described by their schemas. Check the SWAPI documentation to find out more about each of the objects.
- Fork it ( https://github.com/philnash/tatooine/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request