Module: FFaker::NameSN

Extended by:
ModuleUtils, NameSN
Included in:
NameSN
Defined in:
lib/ffaker/name_sn.rb

Overview

Author PapePathe<pathe.sene@gmail.com> github.com/PapePathe The names & first names in this module were found at this url: www.senegalaisement.com/senegal/noms_et_prenoms.html

Constant Summary collapse

PREFIX_FEMALE =
%w(adja adjaratou mame ndeye)
PREFIX_MALE =
%w(pape eladji mame serigne)

Instance Method Summary collapse

Methods included from ModuleUtils

const_missing, k, underscore

Instance Method Details

#first_name_femaleObject



22
23
24
# File 'lib/ffaker/name_sn.rb', line 22

def first_name_female
  FIRST_NAMES_FEMALE.sample
end

#first_name_maleObject



18
19
20
# File 'lib/ffaker/name_sn.rb', line 18

def first_name_male
  FIRST_NAMES_MALE.sample
end

#last_nameObject



14
15
16
# File 'lib/ffaker/name_sn.rb', line 14

def last_name
  LAST_NAMES.sample
end

#name_femaleObject



44
45
46
47
48
49
50
51
52
# File 'lib/ffaker/name_sn.rb', line 44

def name_female
  case rand(10)
  when 7 then "#{prefix_female} #{first_name_female} #{last_name}"
  when 5 then "#{prefix_female} #{first_name_female} #{last_name}"
  when 3 then "#{first_name_female} #{last_name}"
  when 0 then "#{first_name_female} #{last_name}"
  else        "#{first_name_female} #{last_name}"
  end
end

#name_maleObject



34
35
36
37
38
39
40
41
42
# File 'lib/ffaker/name_sn.rb', line 34

def name_male
  case rand(10)
  when 7 then "#{prefix_male} #{first_name_male} #{last_name}"
  when 5 then "#{prefix_male} #{first_name_male} #{last_name}"
  when 3 then "#{first_name_male} #{last_name}"
  when 0 then "#{first_name_male} #{last_name}"
  else        "#{first_name_male} #{last_name}"
  end
end

#name_snObject



54
55
56
57
58
59
60
61
62
63
# File 'lib/ffaker/name_sn.rb', line 54

def name_sn
  case rand(10)
  when 7 then "#{prefix_female} #{first_name_female} #{last_name}"
  when 5 then "#{prefix_male} #{first_name_male} #{last_name}"
  when 3 then "#{first_name_male} #{last_name}"
  when 3 then "#{first_name_female} #{last_name}"
  when 0 then "#{first_name_male} #{last_name}"
  else        "#{first_name_female} #{last_name}"
  end
end

#prefix_femaleObject



30
31
32
# File 'lib/ffaker/name_sn.rb', line 30

def prefix_female
  PREFIX_FEMALE.sample
end

#prefix_maleObject



26
27
28
# File 'lib/ffaker/name_sn.rb', line 26

def prefix_male
  PREFIX_MALE.sample
end