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::Coffee methods #1810

Merged
merged 2 commits into from Nov 11, 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
45 changes: 45 additions & 0 deletions lib/faker/default/coffee.rb
Expand Up @@ -5,24 +5,69 @@ class Coffee < Base
flexible :coffee

class << self
##
# Produces a random blend name.
#
# @return [String]
#
# @example
# Faker::Coffee.blend_name #=> "Major Java"
#
# @faker.version next
Copy link
Member

Choose a reason for hiding this comment

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

The methods for Faker::Coffee were added in 1.8.0, except for intensifier which was added in 1.9.0. All of these should be changed to reflect that.

def blend_name
parse('coffee.blend_name')
end

##
# Produces a random coffee origin place.
#
# @return [String]
#
# @example
# Faker::Coffee.origin #=> "Oaxaca, Mexico"
#
# @faker.version next
def origin
country = fetch('coffee.country')
region = fetch("coffee.regions.#{search_format(country)}")
"#{region}, #{country}"
end

##
# Produces a random coffee variety.
#
# @return [String]
#
# @example
# Faker::Coffee.variety #=> "Red Bourbon"
#
# @faker.version next
def variety
fetch('coffee.variety')
end

##
# Produces a string containing a random description of a coffee's taste.
#
# @return [String]
#
# @example
# Faker::Coffee.notes #=> "dull, tea-like, cantaloupe, soy sauce, marshmallow"
#
# @faker.version next
def notes
parse('coffee.notes')
end

##
# Produces a random coffee taste intensity.
#
# @return [String]
#
# @example
# Faker::Coffee.intensifier #=> "mild"
#
# @faker.version next
def intensifier
fetch('coffee.intensifier')
end
Expand Down