pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/emaraschio/swapi-ruby

GitHub - emaraschio/swapi-ruby: The Ruby helper library for swapi · GitHub
Skip to content

emaraschio/swapi-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Swapi Ruby

A Ruby helper library for swapi.co - the Star Wars API

Darth Vader

Description

Documentation: http://swapi.co/documentation

Installation

$ gem install swapi

Basic Usage

require "swapi"

# Will print a JSON response with Luke Skywalker information
luke = Swapi.get_person 1

# Will print a JSON response with Tatooine specs
tatooine = Swapi.get_planet 1

Methods

These are the top-level methods you can use to get resources from swapi.co

get_person(people_id)

Return a single Person resource.

Example::

Swapi.get_person 1
>>> <Person - Luke Skywalker>

get_planet(planet_id)

Return a single Planet resource.

Example::

Swapi.get_planet 1
>>> <Planet - Tatooine>

get_starship(starship_id)

Return a single Starship resource.

Example::

Swapi.get_starship 6
>>> <Starship - Death Star>

get_vehicle(vehicle_id)

Return a single Vehicle resource.

Example::

Swapi.get_vehicle 4
>>> <Vehicle - Sand Crawler>

get_film(film_id)

Return a single Film resource.

Example::

Swapi.get_film 1
>>> <Film - A New Hope>

get_all("resource_type")

Return all the items in a single resource.

Example::

Swapi.get_all "films"

About

The Ruby helper library for swapi

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy