Class: Faussaire::Creamerie

Inherits:
Object
  • Object
show all
Defined in:
lib/faussaire/creamerie.rb

Constant Summary collapse

DATA_PATH =
File.expand_path('../../locale/fr.yml', __dir__)

Class Method Summary collapse

Class Method Details

.butterHash

Produces a random butter.

Examples:

Faussaire::Creamerie.butter #=> { name: ..., type: ... }

Returns:

  • (Hash)


26
27
28
29
30
31
# File 'lib/faussaire/creamerie.rb', line 26

def butter
  {
    name: fetch('fr.faussaire.creamerie.butter.name'),
    type: fetch('fr.faussaire.creamerie.butter.type')
  }
end

.butter_producersString

Produces information about top butter producers.

Examples:

Faussaire::Creamerie.butter_producers #=> "N°1: États-Unis (892,801 t)"

Returns:

  • (String)


40
41
42
# File 'lib/faussaire/creamerie.rb', line 40

def butter_producers
  fetch('fr.faussaire.creamerie.butter.top_producers')
end

.cheeseHash

Produces a random cheese.

Examples:

Faussaire::Creamerie.cheese #=> { type: ..., name: ..., region: ... }

Returns:

  • (Hash)


51
52
53
54
55
56
57
# File 'lib/faussaire/creamerie.rb', line 51

def cheese
  {
    type: fetch('fr.faussaire.creamerie.cheese.type'),
    name: fetch('fr.faussaire.creamerie.cheese.name'),
    region: fetch('fr.faussaire.creamerie.cheese.region')
  }
end

.milk_typeString

Produces a random milk type.

Examples:

Faussaire::Creamerie.milk_type #=> "de vache"

Returns:

  • (String)


15
16
17
# File 'lib/faussaire/creamerie.rb', line 15

def milk_type
  fetch('fr.faussaire.creamerie.milk_type')
end