Class: Faker::Nation

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

Constant Summary

Constants inherited from Base

Base::Letters, Base::Numbers, Base::ULetters

Class Method Summary collapse

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_cityObject

Fetch random capital city


23
24
25
# File 'lib/faker/default/nation.rb', line 23

def capital_city
  fetch('nation.capital_city')
end

.flagObject

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

.languageObject

Fetch random language


18
19
20
# File 'lib/faker/default/nation.rb', line 18

def language
  fetch('nation.language')
end

.national_sportObject

Fetch random natinal sport


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

def national_sport
  fetch('team.sport')
end

.nationalityObject

Fetch random nationality


8
9
10
# File 'lib/faker/default/nation.rb', line 8

def nationality
  fetch('nation.nationality')
end