nutrition_facts 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cbceada6a16fe84638023349f57a8e816d30f212
4
- data.tar.gz: 9c61c01d154062d2d2c700af60120b491f4ff7a7
3
+ metadata.gz: 051c404a01d0b641b7bc51261222a5ea1c1558ee
4
+ data.tar.gz: c0d1671d2114dc1e7b853d858426aca7f09c8007
5
5
  SHA512:
6
- metadata.gz: 710a1b67f1f69009b1fbde7a9e46f0fbaa37d4dc9956c5bb59b930afcf4818b391bd42a9684e68d22bd15408c3abc6e118131c97ca4a57b8436d77c8fa1e7cca
7
- data.tar.gz: dd71541cd0ad52e1152954d7f69721d8496c41034b52c37bd8c1a6a6a40190cd575313c64c5c8a6db00ecbd1050762796445aa25a74eb16e5e8e825ba9f630d8
6
+ metadata.gz: 98580bf36402ecf548a7a35aff490028ebd22fa71f356789d2ad97a2c1fa2162eb7ccc543d264fe95a8e66aa9c3c1011a165fb184d455b0f26665b9ee5563cf7
7
+ data.tar.gz: 7a7c8a8696063cb3eb18e4dee7bcb9df6e0d71c0617ea75da168d26398abe6869a38f70c473cbe3103a5f87f06110978a7a19372bd191e9dd2c50bca2ada4591
@@ -90,15 +90,22 @@ class NutritionFacts::CLI
90
90
  puts ''
91
91
  puts food_item_data.item_name.to_s
92
92
  puts '---'
93
+ puts "Serving Size: #{food_item_data.nf_serving_size_qty} #{food_item_data.nf_serving_size_unit}"
94
+ puts "Serving Weight: #{food_item_data.nf_serving_weight_grams}g"
93
95
  puts "Calories: #{food_item_data.nf_calories} kcal"
96
+ puts "Calories from fat: #{food_item_data.nf_calories_from_fat} kcal"
94
97
  puts "Total Fat: #{food_item_data.nf_total_fat}g"
98
+ puts "Saturated Fat: #{food_item_data.nf_saturated_fat}g"
99
+ puts "Cholesterol: #{food_item_data.nf_cholesterol}mg"
95
100
  puts "Protein: #{food_item_data.nf_protein}g"
96
- puts "Dietary Fiber: #{food_item_data.nf_dietary_fiber}g"
101
+ puts "Total Carbohydrates: #{food_item_data.nf_total_carbohydrate}g"
97
102
  puts "Sugar: #{food_item_data.nf_sugars}g"
103
+ puts "Dietary Fiber: #{food_item_data.nf_dietary_fiber}g"
98
104
  puts "Sodium: #{food_item_data.nf_sodium}mg"
99
105
  puts "Vitamin C: #{food_item_data.nf_vitamin_c_dv}%"
100
106
  puts "Vitamin A: #{food_item_data.nf_vitamin_a_dv}%"
101
- puts "Serving Size: #{food_item_data.nf_serving_weight_grams}g"
107
+ puts "Calcium: #{food_item_data.nf_calcium_dv}%"
108
+ puts "Iron: #{food_item_data.nf_iron_dv}%"
102
109
  loop_or_quit
103
110
  end
104
111
  end
@@ -4,7 +4,9 @@ class NutritionFacts::Item
4
4
  :nf_total_carbohydrate, :nf_dietary_fiber, :nf_sugars,
5
5
  :nf_protein, :nf_serving_size_qty, :nf_serving_size_unit,
6
6
  :nf_serving_weight_grams, :nf_sodium, :nf_vitamin_c_dv,
7
- :nf_vitamin_a_dv
7
+ :nf_vitamin_a_dv, :nf_calories_from_fat, :nf_saturated_fat,
8
+ :nf_cholesterol, :nf_calcium_dv, :nf_iron_dv,
9
+ :nf_serving_size_qty, :nf_serving_size_unit
8
10
 
9
11
  @@all = []
10
12
 
@@ -15,7 +17,7 @@ class NutritionFacts::Item
15
17
  end
16
18
 
17
19
  def self.find_by_name(name)
18
- uri = URI.parse("https://api.nutritionix.com/v1_1/search/#{name}?results=0%3A9&cal_min=0&cal_max=50000&fields=item_name%2Cnf_calories%2Cnf_total_fat%2Cnf_total_carbohydrate%2Cnf_dietary_fiber%2Cnf_sugars%2Cnf_protein%2Cnf_serving_weight_grams%2Cnf_sodium%2Cnf_vitamin_a_dv%2Cnf_vitamin_c_dv&appId=da276553&appKey=f501b79647768ba684af20428a44ef59")
20
+ uri = URI.parse("https://api.nutritionix.com/v1_1/search/#{name}?results=0%3A9&cal_min=0&cal_max=50000&fields=item_name%2Cnf_calories%2Cnf_total_fat%2Cnf_total_carbohydrate%2Cnf_dietary_fiber%2Cnf_sugars%2Cnf_protein%2Cnf_serving_weight_grams%2Cnf_cholesterol%2Cnf_saturated_fat%2Cnf_calories_from_fat%2Cnf_sodium%2Cnf_calcium_dv%2Cnf_iron_dv%2Cnf_vitamin_a_dv%2Cnf_vitamin_c_dv%2Cnf_serving_size_qty%2Cnf_serving_size_unit&appId=da276553&appKey=f501b79647768ba684af20428a44ef59")
19
21
 
20
22
  response = Net::HTTP.get_response(uri)
21
23
 
@@ -1,3 +1,3 @@
1
1
  module NutritionFacts
2
- VERSION = '0.7.0'.freeze
2
+ VERSION = '0.8.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nutrition_facts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Preiser