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

Faker::WorldCup YARD docs #1789

Merged
merged 5 commits into from
Oct 10, 2019
Merged
Changes from 2 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
50 changes: 50 additions & 0 deletions lib/faker/default/world_cup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,56 @@
module Faker
class WorldCup < Base
class << self
##
# Produces a national team name.
#
# @return [String]
#
# @example
# Faker::WorldCup.team #=> "Iran"
#
# @faker.version next
ashishra0 marked this conversation as resolved.
Show resolved Hide resolved
def team
fetch('world_cup.teams')
end

##
# Produces a city name hosting the world cup match.
ashishra0 marked this conversation as resolved.
Show resolved Hide resolved
#
# @return [String]
#
# @example
# Faker::WorldCup.city #=> "Moscow"
#
# @faker.version next
def city
fetch('world_cup.cities')
end

##
# Produces a stadium name hosting the world cup match.
ashishra0 marked this conversation as resolved.
Show resolved Hide resolved
#
# @return [String]
#
# @example
# Faker::WorldCup.stadium #=> "Rostov Arena"
#
# @faker.version next
def stadium
fetch('world_cup.stadiums')
end

##
# Produces a random national team name from a group. See below examples
Copy link
Member

Choose a reason for hiding this comment

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

You can remove the "See below examples." from these descriptions :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright will do :)

#
# @return [String]
#
# @example
# Faker::WorldCup.group(group: 'group_B') #=> "Spain"
# @example
# Faker::WorldCup.group #=> "Russia"
#
# @faker.version next
def group(legacy_group = NOT_GIVEN, group: 'group_A')
warn_for_deprecated_arguments do |keywords|
keywords << :group if legacy_group != NOT_GIVEN
Expand All @@ -23,6 +61,18 @@ def group(legacy_group = NOT_GIVEN, group: 'group_A')
fetch("world_cup.groups.#{group}")
end

##
# Produces a random name from national team roster. See below examples.
#
# @return [String]
#
# @example
# Faker::WorldCup.roster #=> "Hector Cuper"
#
# @example
# Faker::WorldCup.roster(country: 'Spain', type: 'forwards') #=> "Diego Costa"
#
# @faker.version next
def roster(legacy_country = NOT_GIVEN, legacy_type = NOT_GIVEN, country: 'Egypt', type: 'coach')
warn_for_deprecated_arguments do |keywords|
keywords << :country if legacy_country != NOT_GIVEN
Expand Down