class Openfoodfacts::NutritionGrade
Constants
- LOCALE_PATHS
TODO: Add more locales
Public Class Methods
all(locale: DEFAULT_LOCALE, domain: DEFAULT_DOMAIN)
click to toggle source
Get nutrition grades
# File lib/openfoodfacts/nutrition_grade.rb, line 18 def all(locale: DEFAULT_LOCALE, domain: DEFAULT_DOMAIN) if path = LOCALE_PATHS[locale] Product.tags_from_page(self, "https://#{locale}.#{domain}/#{path}") end end
Public Instance Methods
products(page: -1)
click to toggle source
Get products with nutrition grade
# File lib/openfoodfacts/nutrition_grade.rb, line 28 def products(page: -1) Product.from_website_page(url, page: page, products_count: products_count) if url end