Project

luchadeer

0.0
No commit activity in last 3 years
No release in over 3 years
The bombingest Giant Bomb API client library for Ruby.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.5
>= 0
>= 0

Runtime

~> 0.10
 Project Readme

Luchadeer

Build Status Coverage Status Code Climate Gem Version

The bombingest Giant Bomb API client library for Ruby.

Features

  1. Supports all resources exposed by the Giant Bomb API. For a full list, see the documentation.
  2. Caches API responses.
  3. Fully unit-tested.
  4. fully.recursive.dot.syntax, no random hash[:syntax] cutoff point
  5. Fetch full details for partial objects (e.g. embedded results) with object.detail.
  6. Use convenience methods on a default client per-thread, or use an alternate syntax for full control of the client object.

Configuration

Get your API key here. If you have a premium account, your API key should give you access to subscriber-only video resources, as well as links to HD-quality videos.

Luchadeer.configure(api_key: 'my_api_key') # default client for this thread
Luchadeer::Client.new(api_key: 'my_api_key')

Usage

# Resources by name
# (you can omit the search query if you like)
Luchadeer::Game.search 'persona 4'
my_client.games 'persona 4'
Luchadeer::Video.search 'unprofessional'
my_client.videos 'unprofessional'

# Resources by ID
Luchadeer::Game.find 21373
my_client.game 21373
Luchadeer::RatingBoard.find 3
my_client.rating_board 3

# Custom searches (some random examples, mix and match as you like)
Luchadeer.search(page: 1, limit: 50, query: 'valkyria')

Luchadeer.search do |s|
  s.query = 'valkyria'
  s.page = 1
  s.limit = 50
end

search = Luchadeer::Search.new
search.page(1).limit(50).sort('name', :desc) # default is :asc
search.resources [Luchadeer::Game, Luchadeer::Character] # strings work too
search.query 'valkyria'
results = search.fetch

TODO

  1. Add custom filtering to search (i.e., the 'filter' request parameter).
  2. Make the caching layer more flexible - more options besides in-memory store. Add a null store, too.
  3. 'ghost' object pattern - lazy-load details for partial models when they're accessed, instead of requiring manual '.detail' invocation