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 docs for Faker::Restaurant #1768

Merged
merged 1 commit into from Sep 29, 2019
Merged
Changes from all commits
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
56 changes: 54 additions & 2 deletions lib/faker/default/restaurant.rb
Expand Up @@ -4,8 +4,60 @@ module Faker
class Restaurant < Base
flexible :restaurant

def self.name
bothify(parse('restaurant.name'))
class << self
##
# Produces the name of a restaurant.
#
# @return [String]
#
# @example
# Faker::Restaurant.name #=> "Curry King"
#
# @faker.version 1.9.2
def name
bothify(parse('restaurant.name'))
end

##
# Produces a type of restaurant.
#
# @return [String]
#
# @example
# Faker::Restaurant.type #=> "Comfort Food"
#
# @faker.version 1.9.2
def type
fetch('restaurant.type')
end

##
# Produces a description of a restaurant.
#
# @return [String]
#
# @example
# Faker::Restaurant.description
# #=> "We are committed to using the finest ingredients in our recipes. No food leaves our kitchen that we ourselves would not eat."
#
# @faker.version 1.9.2
def description
fetch('restaurant.description')
end

##
# Produces a review for a restaurant.
#
# @return [String]
#
# @example
# Faker::Restaurant.review
# #=> "Brand new. Great design. Odd to hear pop music in a Mexican establishment. Music is a bit loud. It should be background."
#
# @faker.version 1.9.2
def review
fetch('restaurant.review')
end
end
end
end