class Openbeautyfacts::Origin
Constants
- LOCALE_PATHS
TODO: Add more locales
Public Class Methods
all(locale: DEFAULT_LOCALE, domain: DEFAULT_DOMAIN)
click to toggle source
Get origins
# File lib/openbeautyfacts/origin.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 origin
# File lib/openbeautyfacts/origin.rb, line 28 def products(page: -1) Product.from_website_page(url, page: page, products_count: products_count) if url end