Class: Openbeautyfacts::Allergen

Inherits:
Openfoodfacts::Allergen
  • Object
show all
Defined in:
lib/openbeautyfacts/allergen.rb

Constant Summary collapse

DEFAULT_LOCALE =

Override constants for openbeautyfacts domain

Locale::GLOBAL
DEFAULT_DOMAIN =
'openbeautyfacts.org'

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all(locale: DEFAULT_LOCALE, domain: DEFAULT_DOMAIN, **options) ⇒ Object

Override all method to use openbeautyfacts domain if it exists



11
12
13
14
15
# File 'lib/openbeautyfacts/allergen.rb', line 11

def all(locale: DEFAULT_LOCALE, domain: DEFAULT_DOMAIN, **options)
  super(locale: locale, domain: domain, **options)
rescue NoMethodError
  # Method doesn't exist in parent class, skip
end

Instance Method Details

#products(page: -1)) ⇒ Object

Override products method to use openbeautyfacts domain if it exists



19
20
21
22
23
# File 'lib/openbeautyfacts/allergen.rb', line 19

def products(page: -1)
  super(page: page)
rescue NoMethodError
  # Method doesn't exist in parent class, skip
end