Class: Faker::Food

Inherits:
Base
  • Object
show all
Defined in:
lib/faker/default/food.rb

Constant Summary

Constants inherited from Base

Base::LLetters, Base::Letters, Base::NOT_GIVEN, Base::Numbers, Base::ULetters

Class Method Summary collapse

Methods inherited from Base

bothify, disable_enforce_available_locales, fetch, fetch_all, flexible, generate, letterify, method_missing, numerify, parse, rand, rand_in_range, regexify, resolve, respond_to_missing?, sample, shuffle, translate, unique, with_locale

Class Method Details

.allergenString

Retrieves an allergen.

Examples:

Faker::Food.allergen #=> "Peanuts"

Returns:

  • (String)

Available since:

  • next



17
18
19
# File 'lib/faker/default/food.rb', line 17

def allergen
  fetch('food.allergens')
end

.descriptionString

Retrieves a description about some dish

Examples:

Faker::Food.description #=> "Breaded fried chicken with waffles. Served with maple syrup."

Returns:

  • (String)

Available since:

  • 1.9.0



43
44
45
# File 'lib/faker/default/food.rb', line 43

def description
  fetch('food.descriptions')
end

.dishString

Retrieves a typical dish from each country.

Examples:

Faker::Food.dish #=> "Feijoada"

Returns:

  • (String)

Available since:

  • 1.8.0



30
31
32
# File 'lib/faker/default/food.rb', line 30

def dish
  fetch('food.dish')
end

.ethnic_categoryString

Retrieves ethnic category

Examples:

Faker::Food.ethnic_category #=> "Indian cuisine"

Returns:

  • (String)

Available since:

  • next



134
135
136
# File 'lib/faker/default/food.rb', line 134

def ethnic_category
  fetch('food.ethnic_category')
end

.fruitsString

Retrieves a fruit

Examples:

Faker::Food.fruits #=> "Papaya"

Returns:

  • (String)

Available since:

  • 1.9.0



69
70
71
# File 'lib/faker/default/food.rb', line 69

def fruits
  fetch('food.fruits')
end

.ingredientString

Retrieves an ingredient

Examples:

Faker::Food.ingredient #=> "Olives"

Returns:

  • (String)

Available since:

  • 1.7.0



56
57
58
# File 'lib/faker/default/food.rb', line 56

def ingredient
  fetch('food.ingredients')
end

.measurementString

Retrieves cooking measures

Examples:

Faker::Food.measurement #=> "1/3"

Returns:

  • (String)

Available since:

  • 1.7.0



108
109
110
# File 'lib/faker/default/food.rb', line 108

def measurement
  "#{fetch('food.measurement_sizes')} #{fetch('food.measurements')}"
end

.metric_measurementString

Retrieves metric measurements

Examples:

Faker::Food.metric_measurement #=> "centiliter"

Returns:

  • (String)

Available since:

  • 1.8.3



121
122
123
# File 'lib/faker/default/food.rb', line 121

def metric_measurement
  fetch('food.metric_measurements')
end

.spiceString

Retrieves some random spice

Examples:

Faker::Food.spice #=> "Garlic Chips"

Returns:

  • (String)

Available since:

  • 1.7.0



95
96
97
# File 'lib/faker/default/food.rb', line 95

def spice
  fetch('food.spices')
end

.vegetablesString

Retrieves a vegetable

Examples:

Faker::Food.vegetables #=> "Broccolini"

Returns:

  • (String)

Available since:

  • 1.9.0



82
83
84
# File 'lib/faker/default/food.rb', line 82

def vegetables
  fetch('food.vegetables')
end