Module: FFaker::NameSE

Extended by:
ModuleUtils, NameSE
Includes:
Name
Included in:
NameSE
Defined in:
lib/ffaker/name_se.rb

Constant Summary collapse

PREFIXES =
%w(Dr. Prof.)

Constants included from Name

FFaker::Name::SUFFIXES

Instance Method Summary collapse

Methods included from ModuleUtils

const_missing, k, underscore

Methods included from Name

#suffix

Instance Method Details

#first_nameObject



21
22
23
24
25
26
27
28
29
# File 'lib/ffaker/name_se.rb', line 21

def first_name
  case rand(12)
  when 0..4  then first_name_female
  when 5..9  then first_name_male
  when 10    then "#{first_name_male} #{first_name_male}"
  when 11    then "#{first_name_female} #{first_name_female}"
  else            first_name_female
  end
end

#first_name_femaleObject



31
32
33
# File 'lib/ffaker/name_se.rb', line 31

def first_name_female
  FIRST_NAMES_FEMALE.sample
end

#first_name_maleObject



35
36
37
# File 'lib/ffaker/name_se.rb', line 35

def first_name_male
  FIRST_NAMES_MALE.sample
end

#last_nameObject



39
40
41
# File 'lib/ffaker/name_se.rb', line 39

def last_name
  LAST_NAMES.sample
end

#nameObject



14
15
16
17
18
19
# File 'lib/ffaker/name_se.rb', line 14

def name
  case rand(30)
  when 0 then "#{prefix} #{first_name} #{last_name}"
  else        "#{first_name} #{last_name}"
  end
end

#prefixObject



43
44
45
# File 'lib/ffaker/name_se.rb', line 43

def prefix
  PREFIXES.sample
end