Mat
A small (unofficial) API client for the Mat API.
The documentation is in Swedish, but so is the data.
Installation
Add this line to your application's Gemfile:
gem 'mat'
And then execute:
$ bundle
Or install it yourself as:
$ gem install mat
Usage
It is probably a good idea to take a look in specs
# All nutrients
Mat.nutrients
# Find the first food with ’köttfärs’ in the name
köttfärspaj = Mat.all('Köttfärs').first
# Get the `iron` value
köttfärspaj.iron #=> 1.09
# Find a specific food by its number
food = Mat.find(3)
food.name #=> "Ister gris"
Contributing
- Fork it
- 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 new Pull Request