Skip to content

Commit

Permalink
Add yard docs for Faker::Coffee methods (faker-ruby#1810)
Browse files Browse the repository at this point in the history
* Add yard docs for Faker::Coffee methods

* @faker.version should be 1.9.0
  • Loading branch information
LuanGB authored and michebble committed Feb 16, 2020
1 parent bb2b051 commit 25b1394
Showing 1 changed file with 45 additions and 0 deletions.
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 1.9.0
def blend_name
parse('coffee.blend_name')
end

##
# Produces a random coffee origin place.
#
# @return [String]
#
# @example
# Faker::Coffee.origin #=> "Oaxaca, Mexico"
#
# @faker.version 1.9.0
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 1.9.0
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 1.9.0
def notes
parse('coffee.notes')
end

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

0 comments on commit 25b1394

Please sign in to comment.