Brewry
<img src=“https://travis-ci.org/DanyHunter/brewry.svg?branch=master” alt=“Build Status” />
Brewry gives you an API interface to talk to BreweryDB.
-
It retuns everything as a hash so you can just pass it to ActiveRecord
-
It recursively changes the hash to change the ‘id’ keys into ‘guid’ so it doesn’t interfere with your own ActiveRecord Ids. Changing it to whatever you want is on the works.
-
Thanks to metaprogramming we can query any api endpoint for BreweryDB. See examples below.
Configuration
For Rails:
Create an initializer in config/initializers/brewry.rb
Brewry.configure do |config|
config.api_key = 'some api key'
end
Examples
Fetch some beers with the name argument:
Brewry.search_beers(name: 'Corona Light')
Fetch some styles without arguments - this will return all beer styles:
Brewry.search_styles
Releases
0.0.1
-
Initialize project
TODO
-
Change class so it can be instantiated.
-
Add tests
-
Allow changing of breweryDB id’s into whatever the user needs.