Project

tatooine

0.0
No commit activity in last 3 years
No release in over 3 years
A Ruby interface to SWAPI (the Star Wars API). http://swapi.co/
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6
>= 0
~> 3.5
~> 2.9.3
~> 2.0

Runtime

 Project Readme

Tatooine

A Ruby interface to SWAPI (the Star Wars API).

Build Status

Installation

Add this line to your application's Gemfile:

gem 'tatooine'

And then execute:

$ bundle

Or install it yourself as:

$ gem install tatooine

Usage

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 resource

Schema

In SWAPI the objects are described by their schemas. Check the SWAPI documentation to find out more about each of the objects.

Contributing

  1. Fork it ( https://github.com/philnash/tatooine/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request