From 36f1b8937fc67a51bfe1dc4b038640c47c65c085 Mon Sep 17 00:00:00 2001 From: Connor Shea Date: Sat, 21 Sep 2019 13:44:23 -0600 Subject: [PATCH] Add YARD docs for the Basketball and Football fakers. --- lib/faker/sports/basketball.rb | 36 +++++++++++++++++++++++++++ lib/faker/sports/football.rb | 45 ++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) diff --git a/lib/faker/sports/basketball.rb b/lib/faker/sports/basketball.rb index 341ff65150..88c0fb5671 100644 --- a/lib/faker/sports/basketball.rb +++ b/lib/faker/sports/basketball.rb @@ -4,18 +4,54 @@ module Faker class Sports class Basketball < Base class << self + ## + # Produces the name of a basketball team. + # + # @return [String] + # + # @example + # Faker::Sports::Basketball.team #=> "Golden State Warriors" + # + # @faker.version 1.9.4 def team fetch('basketball.teams') end + ## + # Produces the name of a basketball player. + # + # @return [String] + # + # @example + # Faker::Sports::Basketball.player #=> "LeBron James" + # + # @faker.version 1.9.4 def player fetch('basketball.players') end + ## + # Produces the name of a basketball coach. + # + # @return [String] + # + # @example + # Faker::Sports::Basketball.coach #=> "Gregg Popovich" + # + # @faker.version 1.9.4 def coach fetch('basketball.coaches') end + ## + # Produces a position in basketball. + # + # @return [String] + # + # @example + # Faker::Sports::Basketball.position #=> "Point Guard" + # + # @faker.version 1.9.4 def position fetch('basketball.positions') end diff --git a/lib/faker/sports/football.rb b/lib/faker/sports/football.rb index 7bef5efcf3..835e7b9019 100644 --- a/lib/faker/sports/football.rb +++ b/lib/faker/sports/football.rb @@ -4,22 +4,67 @@ module Faker class Sports class Football < Base class << self + ## + # Produces the name of a football team. + # + # @return [String] + # + # @example + # Faker::Sports::Football.team #=> "Manchester United" + # + # @faker.version 1.9.0 def team fetch('football.teams') end + ## + # Produces the name of a football player. + # + # @return [String] + # + # @example + # Faker::Sports::Football.player #=> "Lionel Messi" + # + # @faker.version 1.9.0 def player fetch('football.players') end + ## + # Produces the name of a football coach. + # + # @return [String] + # + # @example + # Faker::Sports::Football.coach #=> "Jose Mourinho" + # + # @faker.version 1.9.0 def coach fetch('football.coaches') end + ## + # Produces a football competition. + # + # @return [String] + # + # @example + # Faker::Sports::Football.competition #=> "FIFA World Cup" + # + # @faker.version 1.9.0 def competition fetch('football.competitions') end + ## + # Produces a position in football. + # + # @return [String] + # + # @example + # Faker::Sports::Football.position #=> "Defensive Midfielder" + # + # @faker.version 1.9.2 def position fetch('football.positions') end