yummly 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +3 -3
- data/lib/yummly/flavor.rb +6 -5
- data/lib/yummly/recipe.rb +7 -1
- data/lib/yummly/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -40,13 +40,13 @@ Once configured, you have access to two API calls:
|
|
40
40
|
|
41
41
|
The search command returns an array of Yummly::Recipe objects:
|
42
42
|
|
43
|
-
Yummly
|
43
|
+
Yummly.search('Onion soup')
|
44
44
|
|
45
45
|
#### Find
|
46
46
|
|
47
47
|
The find command returns a single Yummly::Recipe object:
|
48
48
|
|
49
|
-
Yummly
|
49
|
+
Yummly.find('French-Onion-Soup-The-Pioneer-Woman-Cooks-_-Ree-Drummond-41364')
|
50
50
|
|
51
51
|
## The Recipe object
|
52
52
|
|
@@ -57,7 +57,7 @@ from the ruby Recipe object.
|
|
57
57
|
|
58
58
|
For example, to access the thumbnail image for a recipe:
|
59
59
|
|
60
|
-
recipe = Yummly
|
60
|
+
recipe = Yummly.find('French-Onion-Soup-The-Pioneer-Woman-Cooks-_-Ree-Drummond-41364')
|
61
61
|
recipe.images.first.small_url
|
62
62
|
|
63
63
|
Explore the Yummly::Recipe class to see the full range of available attributes.
|
data/lib/yummly/flavor.rb
CHANGED
@@ -9,11 +9,12 @@ class Yummly::Flavor
|
|
9
9
|
:sourness
|
10
10
|
|
11
11
|
def initialize(values)
|
12
|
-
@spiciness = values["
|
13
|
-
@bitterness = values["
|
14
|
-
@sweetness = values["
|
15
|
-
@savoriness = values["
|
16
|
-
@sourness = values["
|
12
|
+
@spiciness = values["Piquant"]
|
13
|
+
@bitterness = values["Bitter"]
|
14
|
+
@sweetness = values["Sweet"]
|
15
|
+
@savoriness = values["Meaty"]
|
16
|
+
@sourness = values["Sour"]
|
17
|
+
@saltiness = values["Salty"]
|
17
18
|
end
|
18
19
|
|
19
20
|
end
|
data/lib/yummly/recipe.rb
CHANGED
@@ -46,7 +46,7 @@ class Yummly::Recipe
|
|
46
46
|
|
47
47
|
# @return [Array] collection of strings of ingredients.
|
48
48
|
def ingredients
|
49
|
-
response["ingredients"]
|
49
|
+
response["ingredients"] || ingredient_lines
|
50
50
|
end
|
51
51
|
|
52
52
|
# @return [Array] collection of strings of ingredients.
|
@@ -89,6 +89,12 @@ class Yummly::Recipe
|
|
89
89
|
response["totalTimeInSeconds"]
|
90
90
|
end
|
91
91
|
|
92
|
+
def thumbnail
|
93
|
+
if images
|
94
|
+
images.first.small_url
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
92
98
|
private
|
93
99
|
|
94
100
|
# The search and find API calls populate different image attribute nodes in their respective responses. This method
|
data/lib/yummly/version.rb
CHANGED