module FFaker::NameNB

Constants

PREFIXES

Public Instance Methods

first_name() click to toggle source
# File lib/ffaker/name_nb.rb, line 19
def first_name
  case rand(0..11)
  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}"
  end
end
first_name_female() click to toggle source
# File lib/ffaker/name_nb.rb, line 28
def first_name_female
  fetch_sample(FIRST_NAMES_FEMALE)
end
first_name_male() click to toggle source
# File lib/ffaker/name_nb.rb, line 32
def first_name_male
  fetch_sample(FIRST_NAMES_MALE)
end
last_name() click to toggle source
# File lib/ffaker/name_nb.rb, line 36
def last_name
  fetch_sample(LAST_NAMES)
end
name() click to toggle source
# File lib/ffaker/name_nb.rb, line 12
def name
  case rand(0..29)
  when 0 then "#{prefix} #{first_name} #{last_name}"
  else        "#{first_name} #{last_name}"
  end
end
prefix() click to toggle source
# File lib/ffaker/name_nb.rb, line 40
def prefix
  fetch_sample(PREFIXES)
end