Luchadeer
The bombingest Giant Bomb API client library for Ruby.
Features
- Fully unit-tested.
- Caches API responses.
- fully.recursive.dot.syntax, no random hash[:syntax] cutoff point
- Fetch full details for partial objects (e.g. embedded results) with object.detail.
- Thread-ready (thready?): no global or class state. Use convenience methods to use a default client per-thread, or use an alternate syntax for full control.
Configuration
Get your API key here.
Luchadeer.configure(api_key: 'my_api_key') # default client for this thread
Luchadeer::Client.new(api_key: 'my_api_key')
You can also pass a block to either method, and it will yield the client object to configure to your liking.
Luchadeer.configure do |client|
client.api_key = 'my_api_key'
end
Supported resources
- game
- franchise
- character
- concept
- object
- location
- person
- company
- video
Usage
Luchadeer::Game.find(21373) # or...
my_client.game(21373) # => #<Luchadeer::Game name="Shin Megami Tensei: Persona 4" ...>
TODO
- Add filtering to search.
- Add per-resource searching class methods on each resource object.
- Refactor the test suite with shared example groups.
- Make the caching layer more flexible - more options besides in-memory store. Add a null store, too.