Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add YARD doc for Faker::Food #1802

Merged
merged 4 commits into from Dec 5, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
66 changes: 65 additions & 1 deletion lib/faker/default/food.rb
Expand Up @@ -5,42 +5,106 @@ class Food < Base
flexible :food

class << self
# Retrieves a typical dish from each country
##
# Retrieves a typical dish from each country.
#
# @return [String]
#
# @example
# Faker::Food.dish #=> "Feijoada"
#
# @faker.version 2.6.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These versions should be updated to reflect the original versions the methods were added in.

  • fruits and vegetables were added in 1.9.0 with fe586fb
  • description was added in 1.9.0 with 679fd50
  • metric_measurement was added in 1.8.3 with 802423f
  • dish was added in 1.8.0 with 3669579
  • ingredient, spice, and measurement were added in 1.7.0 with f3e08e6

sap1enza marked this conversation as resolved.
Show resolved Hide resolved
def dish
fetch('food.dish')
end

##
# Retrieves a description about some dish
#
# @return [String]
#
# @example
# Faker::Food.descriptions #=> "Breaded fried chicken with waffles. Served with maple syrup."
sap1enza marked this conversation as resolved.
Show resolved Hide resolved
#
# @faker.version 2.6.0
sap1enza marked this conversation as resolved.
Show resolved Hide resolved
def description
fetch('food.descriptions')
end

##
# Retrieves an ingredient
#
# @return [String]
#
# @example
# Faker::Food.ingredients #=> "Olives"
sap1enza marked this conversation as resolved.
Show resolved Hide resolved
#
# @faker.version 2.6.0
sap1enza marked this conversation as resolved.
Show resolved Hide resolved
def ingredient
fetch('food.ingredients')
end

##
# Retrieves a fruit
#
# @return [String]
#
# @example
# Faker::Food.fruits #=> "Papaya"
#
# @faker.version 2.6.0
sap1enza marked this conversation as resolved.
Show resolved Hide resolved
def fruits
fetch('food.fruits')
end

##
# Retrieves a vegetable
#
# @return [String]
#
# @example
# Faker::Food.vegetables #=> "Broccolini"
#
# @faker.version 2.6.0
sap1enza marked this conversation as resolved.
Show resolved Hide resolved
def vegetables
fetch('food.vegetables')
end

##
# Retrieves some random spice
#
# @return [String]
#
# @example
# Faker::Food.spices #=> "Garlic Chips"
sap1enza marked this conversation as resolved.
Show resolved Hide resolved
#
# @faker.version 2.6.0
sap1enza marked this conversation as resolved.
Show resolved Hide resolved
def spice
fetch('food.spices')
end

##
# Retrieves cooking measures
#
# @return [String]
#
# @example
# Faker::Food.measurement_sizes #=> "1/3"
sap1enza marked this conversation as resolved.
Show resolved Hide resolved
#
# @faker.version 2.6.0
sap1enza marked this conversation as resolved.
Show resolved Hide resolved
def measurement
fetch('food.measurement_sizes') + ' ' + fetch('food.measurements')
end

##
# Retrieves metric mesurements
#
# @return [String]
#
# @example
# Faker::Food.metric_measurements #=> "centiliter"
sap1enza marked this conversation as resolved.
Show resolved Hide resolved
#
# @faker.version 2.6.0
sap1enza marked this conversation as resolved.
Show resolved Hide resolved
def metric_measurement
fetch('food.metric_measurements')
end
Expand Down