Class: Faker::Sport
Constant Summary
Constants inherited from Base
Base::LLetters, Base::Letters, Base::NOT_GIVEN, Base::Numbers, Base::ULetters
Class Method Summary collapse
-
.ancient_olympics_sport ⇒ String
Produces a sport from the ancient olympics.
-
.sport(include_ancient: false, include_unusual: false) ⇒ String
Produces a sport from the modern olympics or paralympics, summer or winter.
-
.summer_olympics_sport ⇒ String
Produces a sport from the summer olympics.
-
.summer_paralympics_sport ⇒ String
Produces a sport from the summer paralympics.
-
.unusual_sport ⇒ String
Produces an unusual sport.
-
.winter_olympics_sport ⇒ String
Produces a sport from the winter olympics.
-
.winter_paralympics_sport ⇒ String
Produces a sport from the winter paralympics.
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
.ancient_olympics_sport ⇒ String
Produces a sport from the ancient olympics.
111 112 113 |
# File 'lib/faker/sports/sport.rb', line 111 def ancient_olympics_sport fetch('sport.ancient_olympics') end |
.sport(include_ancient: false, include_unusual: false) ⇒ String
Produces a sport from the modern olympics or paralympics, summer or winter.
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/faker/sports/sport.rb', line 24 def sport(include_ancient: false, include_unusual: false) sports = [] sports.concat( fetch_all('sport.summer_olympics'), fetch_all('sport.summer_paralympics'), fetch_all('sport.winter_olympics'), fetch_all('sport.winter_paralympics') ) sports.concat(fetch_all('sport.ancient_olympics')) if include_ancient sports.concat(fetch_all('sport.unusual')) if include_unusual sample(sports) end |
.summer_olympics_sport ⇒ String
Produces a sport from the summer olympics.
46 47 48 |
# File 'lib/faker/sports/sport.rb', line 46 def summer_olympics_sport fetch('sport.summer_olympics') end |
.summer_paralympics_sport ⇒ String
Produces a sport from the summer paralympics.
72 73 74 |
# File 'lib/faker/sports/sport.rb', line 72 def summer_paralympics_sport fetch('sport.summer_paralympics') end |
.unusual_sport ⇒ String
Produces an unusual sport.
98 99 100 |
# File 'lib/faker/sports/sport.rb', line 98 def unusual_sport fetch('sport.unusual') end |
.winter_olympics_sport ⇒ String
Produces a sport from the winter olympics.
59 60 61 |
# File 'lib/faker/sports/sport.rb', line 59 def winter_olympics_sport fetch('sport.winter_olympics') end |
.winter_paralympics_sport ⇒ String
Produces a sport from the winter paralympics.
85 86 87 |
# File 'lib/faker/sports/sport.rb', line 85 def winter_paralympics_sport fetch('sport.winter_paralympics') end |