Class: Faker::Nation
Constant Summary
Constants inherited from Base
Base::Letters, Base::Numbers, Base::ULetters
Class Method Summary collapse
-
.capital_city ⇒ Object
Fetch random capital city.
-
.flag ⇒ Object
Fetch random national flag emoji.
-
.language ⇒ Object
Fetch random language.
-
.national_sport ⇒ Object
Fetch random natinal sport.
-
.nationality ⇒ Object
Fetch random nationality.
Methods inherited from Base
bothify, disable_enforce_available_locales, fetch, fetch_all, flexible, letterify, method_missing, numerify, parse, rand, rand_in_range, regexify, resolve, respond_to_missing?, sample, shuffle, translate, unique, with_locale
Class Method Details
.capital_city ⇒ Object
Fetch random capital city
23 24 25 |
# File 'lib/faker/default/nation.rb', line 23 def capital_city fetch('nation.capital_city') end |
.flag ⇒ Object
Fetch random national flag emoji
13 14 15 |
# File 'lib/faker/default/nation.rb', line 13 def flag sample(translate('faker.nation.flag')).pack('C*').force_encoding('utf-8') end |
.language ⇒ Object
Fetch random language
18 19 20 |
# File 'lib/faker/default/nation.rb', line 18 def language fetch('nation.language') end |
.national_sport ⇒ Object
Fetch random natinal sport
28 29 30 |
# File 'lib/faker/default/nation.rb', line 28 def national_sport fetch('team.sport') end |
.nationality ⇒ Object
Fetch random nationality
8 9 10 |
# File 'lib/faker/default/nation.rb', line 8 def nationality fetch('nation.nationality') end |