$ gem install igdb2
$ Igdb.connect('api_key')
If no parameter is given, Igdb will default to ENV['IGDB_KEY'].
$ Igdb.connect # => Igdb.connect(ENV['IGDB_KEY'])
Find game by ID
$ Igdb::Game.find(1971)
Find game by ID with options
$ Igdb::Game.find(1971, fields: 'slug,name')
Find a game by slug
$ Igdb::Game.find('world-of-warcraft')
Select multiple games
$ Igdb::Game.select(1, 2, 3, order: 'popularity:desc') # OR .select([1, 2, 3])
Select multiple games with options
$ Igdb::Game.select(
[1, 2, 3],
expand: 'genres'
fields: 'name,genres.name'
)
Return a list of all games
$ Igdb::Game.all
$ Igdb::Game.all(limit: 10) # Limit to 10 results - Default 50 (Max)
$ Igdb::Game.all(offset: 5) # Offset result starting at 5th - Default 0
Search for games
$ Igdb::Game.all(search: 'super mario')
Return the number of games in the database
$ Igdb::Game.count
Return the available properties of games
$ Igdb::Game.meta
Igdb::Character
Igdb::Collection
Igdb::Company
Igdb::Credits
Igdb::Feed
Igdb::Franchise
Igdb::GameEngine
Igdb::GameMode
Igdb::Game
Igdb::Genre
Igdb::Keyword
Igdb::Page
Igdb::Person
Igdb::Platform
Igdb::PlayerPerspective
Igdb::PulseGroup
Igdb::Pulse
Igdb::PulseSource
Igdb::ReleaseDate
Igdb::Review
Igdb::Theme
Igdb::Title
Igdb::Version
See IGDB Documentation for more information on endpoints and writing requests.
- Fork it ( https://github.com/kalynrobinson/igdb/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