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, letterify, method_missing, numerify, parse, rand, rand_in_range, regexify, resolve, respond_to_missing?, sample, shuffle, translate, unique, with_locale

Class Method Details

.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


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

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


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

def dish
  fetch('food.dish')
end

.fruitsString

Retrieves a fruit

Examples:

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

Returns:

  • (String)

Available since:

  • 1.9.0


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

def fruits
  fetch('food.fruits')
end

.ingredientString

Retrieves an ingredient

Examples:

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

Returns:

  • (String)

Available since:

  • 1.7.0


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

def ingredient
  fetch('food.ingredients')
end

.measurementString

Retrieves cooking measures

Examples:

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

Returns:

  • (String)

Available since:

  • 1.7.0


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

def measurement
  fetch('food.measurement_sizes') + ' ' + fetch('food.measurements')
end

.metric_measurementString

Retrieves metric mesurements

Examples:

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

Returns:

  • (String)

Available since:

  • 1.8.3


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

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


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

def spice
  fetch('food.spices')
end

.vegetablesString

Retrieves a vegetable

Examples:

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

Returns:

  • (String)

Available since:

  • 1.9.0


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

def vegetables
  fetch('food.vegetables')
end