Class: Faker::WorldCup

Inherits:
Base
  • Object
show all
Defined in:
lib/faker/default/world_cup.rb

Constant Summary

Constants inherited from Base

Base::LLetters, Base::Letters, Base::NOT_GIVEN, Base::Numbers, Base::ULetters

Class Method Summary collapse

Methods inherited from Base

bothify, disable_enforce_available_locales, fetch, fetch_all, flexible, generate, letterify, method_missing, numerify, parse, rand, rand_in_range, regexify, resolve, respond_to_missing?, sample, shuffle, shuffle!, translate, unique, with_locale

Class Method Details

.cityString

Produces a city name hosting the World Cup match.

Examples:

Faker::WorldCup.city #=> "Moscow"

Returns:



28
29
30
# File 'lib/faker/default/world_cup.rb', line 28

def city
  fetch('world_cup.cities')
end

.group(group: 'group_A') ⇒ String

Produces a random national team name from a group.

Examples:

Faker::WorldCup.group(group: 'group_B') #=> "Spain"
Faker::WorldCup.group #=> "Russia"

Returns:



56
57
58
# File 'lib/faker/default/world_cup.rb', line 56

def group(group: 'group_A')
  fetch("world_cup.groups.#{group}")
end

.roster(country: 'Egypt', type: 'coach') ⇒ String

Produces a random name from national team roster.

Examples:

Faker::WorldCup.roster #=> "Hector Cuper"
Faker::WorldCup.roster(country: 'Spain', type: 'forwards') #=> "Diego Costa"

Returns:



72
73
74
# File 'lib/faker/default/world_cup.rb', line 72

def roster(country: 'Egypt', type: 'coach')
  fetch("world_cup.rosters.#{country}.#{type}")
end

.stadiumString

Produces the name of a stadium that has hosted a World Cup match.

Examples:

Faker::WorldCup.stadium #=> "Rostov Arena"

Returns:



41
42
43
# File 'lib/faker/default/world_cup.rb', line 41

def stadium
  fetch('world_cup.stadiums')
end

.teamString

Produces a national team name.

Examples:

Faker::WorldCup.team #=> "Iran"

Returns:



15
16
17
# File 'lib/faker/default/world_cup.rb', line 15

def team
  fetch('world_cup.teams')
end