Class: Faker::Sports::Chess
Constant Summary
Constants inherited from Base
Base::LLetters, Base::Letters, Base::NOT_GIVEN, Base::Numbers, Base::ULetters
Class Method Summary collapse
-
.federation ⇒ String
Produces a long (alpha-3) ISO 3166 country code.
-
.opening ⇒ String
Produces the name of a chess opening.
-
.player ⇒ String
Produces the name of a chess player name.
- .rating(from: 2000, to: 2900) ⇒ Object
-
.title ⇒ String
Produces a chess title.
- .tournament ⇒ Object
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
.federation ⇒ String
Produces a long (alpha-3) ISO 3166 country code.
29 30 31 |
# File 'lib/faker/sports/chess.rb', line 29 def federation Faker::Address.country_code_long end |
.opening ⇒ String
Produces the name of a chess opening.
71 72 73 |
# File 'lib/faker/sports/chess.rb', line 71 def opening fetch('chess.openings') end |
.player ⇒ String
Produces the name of a chess player name.
16 17 18 |
# File 'lib/faker/sports/chess.rb', line 16 def player fetch('chess.players') end |
.rating(from: 2000, to: 2900) ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/faker/sports/chess.rb', line 46 def (from: 2000, to: 2900) ## # Produces a rating between two provided values. Boundaries are inclusive. # # @param from [Numeric] The lowest number to include. # @param to [Numeric] The highest number to include. # @return [Numeric] # # @example # Faker::Sports::Chess.rating #=> 2734 # Faker::Sports::Chess.rating(from: 2400, to: 2700) #=> 2580 # # @faker.version next Faker::Base.rand_in_range(from, to) end |
.title ⇒ String
Produces a chess title.
84 85 86 |
# File 'lib/faker/sports/chess.rb', line 84 def title fetch('chess.titles') end |
.tournament ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/faker/sports/chess.rb', line 33 def tournament ## # Produces the name of a famous chess tournament name. # # @return [String] # # @example # Faker::Chess.tournament #=> "Khanty-Mansisyk (Candidates Tournament)" # # @faker.version next fetch('chess.tournaments') end |