zutat 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +17 -3
- data/lib/zutat/client.rb +1 -3
- data/lib/zutat/version.rb +1 -1
- data/zutat.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da41dc0bc781059e0e457538321a9e5392817f1b
|
4
|
+
data.tar.gz: 9b5c10b6e46ad189e1f8de570ac92230e081cfed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0689db0641f78358555f93ea7604d2320b53fadc9abab732f8dc75e37919c0d002df684095c32d8c905b019493f42308f47305ab0a828eec38bf49e4aedf7f25
|
7
|
+
data.tar.gz: 6353e7e7a108a2d3653fe3cbc23170461bd7c9bd77ee2a327682c05ed36c2e9666add7a4e73054f20ac08b4424f33e04f7a0162510612b7ac9b93c1cebe966c1
|
data/README.md
CHANGED
@@ -15,19 +15,33 @@ At first, you should require the gem. Otherwise it won't work.
|
|
15
15
|
```ruby
|
16
16
|
require 'zutat'
|
17
17
|
```
|
18
|
-
|
18
|
+
### Initialize a client
|
19
19
|
Then you must initialize a new client.
|
20
20
|
```ruby
|
21
21
|
client = Zutat::Client.new
|
22
22
|
```
|
23
23
|
|
24
|
-
|
25
|
-
|
24
|
+
### Fetch a recipe
|
25
|
+
At this point, you can get a recipe by its ID. If I want the "People Chow 3.0.1" recipe, I type:
|
26
26
|
```ruby
|
27
27
|
recipe = client.get_recipe "people-chow-301-tortilla-perfection"
|
28
28
|
```
|
29
29
|
|
30
|
+
### Using the recipe object
|
31
|
+
If I want to know, how many calories are specified as nutrient target I simply use:
|
32
|
+
```ruby
|
33
|
+
puts recipe.nutrient_targets.calories
|
34
|
+
```
|
35
|
+
|
36
|
+
Or when I want to know the source (to buy) for each ingredient in this recipe:
|
37
|
+
```ruby
|
38
|
+
recipe.ingredients.each do |ingredient|
|
39
|
+
puts ingredient.source
|
40
|
+
end
|
41
|
+
```
|
42
|
+
|
30
43
|
## TODO
|
44
|
+
* Adding index with all objects
|
31
45
|
* Adding search feature
|
32
46
|
* Optimizing attributes from Zutat::Ingredients and Zutat::NutrientTargets
|
33
47
|
|
data/lib/zutat/client.rb
CHANGED
data/lib/zutat/version.rb
CHANGED
data/zutat.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'zutat'
|
4
|
-
s.version = '0.0.
|
4
|
+
s.version = '0.0.3'
|
5
5
|
s.date = '2014-10-04'
|
6
6
|
s.summary = "Get Soylent recipes from diy.soylent.me."
|
7
7
|
s.description = "Fetch Soylent recipes from diy.soylent.me and get easy-to-use Ruby objects."
|