Class: Openfoodfacts::IngredientThatMayBeFromPalmOil
- Inherits:
-
Hashie::Mash
- Object
- Hashie::Mash
- Openfoodfacts::IngredientThatMayBeFromPalmOil
- Defined in:
- lib/openfoodfacts/ingredient_that_may_be_from_palm_oil.rb
Constant Summary collapse
- LOCALE_PATHS =
TODO: Add more locales
{ 'fr' => 'ingredients-pouvant-etre-issus-de-l-huile-de-palme', 'uk' => 'ingredients-that-may-be-from-palm-oil', 'us' => 'ingredients-that-may-be-from-palm-oil', 'world' => 'ingredients-that-may-be-from-palm-oil' }
Class Method Summary collapse
-
.all(locale: DEFAULT_LOCALE, domain: DEFAULT_DOMAIN) ⇒ Object
Get ingredients that may be from palm oil.
Instance Method Summary collapse
-
#products(page: -1)) ⇒ Object
Get products with ingredient that may be from palm oil.
Class Method Details
.all(locale: DEFAULT_LOCALE, domain: DEFAULT_DOMAIN) ⇒ Object
Get ingredients that may be from palm oil
18 19 20 21 22 |
# File 'lib/openfoodfacts/ingredient_that_may_be_from_palm_oil.rb', line 18 def all(locale: DEFAULT_LOCALE, domain: DEFAULT_DOMAIN) if path = LOCALE_PATHS[locale] Product.(self, "https://#{locale}.#{domain}/#{path}") end end |
Instance Method Details
#products(page: -1)) ⇒ Object
Get products with ingredient that may be from palm oil
28 29 30 |
# File 'lib/openfoodfacts/ingredient_that_may_be_from_palm_oil.rb', line 28 def products(page: -1) Product.from_website_page(url, page: page, products_count: products_count) if url end |