Skip to content

Commit

Permalink
add YARD doc for Faker::Food (faker-ruby#1802)
Browse files Browse the repository at this point in the history
* add food docs

* Apply suggestions from code review

Co-Authored-By: Connor Shea <connor.james.shea@gmail.com>

* Apply suggestions from code review

Co-Authored-By: Connor Shea <connor.james.shea@gmail.com>

* Apply suggestions from code review
  • Loading branch information
sap1enza authored and vbrazo committed Dec 5, 2019
1 parent 3ddb525 commit 97fb715
Showing 1 changed file with 65 additions and 1 deletion.
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 1.8.0
def dish
fetch('food.dish')
end

##
# Retrieves a description about some dish
#
# @return [String]
#
# @example
# Faker::Food.description #=> "Breaded fried chicken with waffles. Served with maple syrup."
#
# @faker.version 1.9.0
def description
fetch('food.descriptions')
end

##
# Retrieves an ingredient
#
# @return [String]
#
# @example
# Faker::Food.ingredient #=> "Olives"
#
# @faker.version 1.7.0
def ingredient
fetch('food.ingredients')
end

##
# Retrieves a fruit
#
# @return [String]
#
# @example
# Faker::Food.fruits #=> "Papaya"
#
# @faker.version 1.9.0
def fruits
fetch('food.fruits')
end

##
# Retrieves a vegetable
#
# @return [String]
#
# @example
# Faker::Food.vegetables #=> "Broccolini"
#
# @faker.version 1.9.0
def vegetables
fetch('food.vegetables')
end

##
# Retrieves some random spice
#
# @return [String]
#
# @example
# Faker::Food.spice #=> "Garlic Chips"
#
# @faker.version 1.7.0
def spice
fetch('food.spices')
end

##
# Retrieves cooking measures
#
# @return [String]
#
# @example
# Faker::Food.measurement #=> "1/3"
#
# @faker.version 1.7.0
def measurement
fetch('food.measurement_sizes') + ' ' + fetch('food.measurements')
end

##
# Retrieves metric mesurements
#
# @return [String]
#
# @example
# Faker::Food.metric_measurement #=> "centiliter"
#
# @faker.version 1.8.3
def metric_measurement
fetch('food.metric_measurements')
end
Expand Down

0 comments on commit 97fb715

Please sign in to comment.