module FFaker::CompanyFR

Constants

SUFFIXES

Public Instance Methods

name() click to toggle source
# File lib/ffaker/company_fr.rb, line 10
def name
  case rand(0..2)
  when 0 then "#{NameFR.last_name} #{suffix}"
  when 1 then "#{NameFR.last_name}-#{NameFR.last_name}"
  when 2 then "#{NameFR.last_name}, #{NameFR.last_name} and #{NameFR.last_name}"
  end
end
siren() click to toggle source

Get a random French SIREN number. See more here fr.wikipedia.org/wiki/Syst%C3%A8me_d%27identification_du_r%C3%A9pertoire_des_entreprises

# File lib/ffaker/company_fr.rb, line 23
def siren
  base = FFaker.numerify('########')
  base + luhn_check(base).to_s
end
siret() click to toggle source

Produces a company french siret number.

# File lib/ffaker/company_fr.rb, line 29
def siret
  location = rand(0..99).to_s.rjust(4, '0')
  org_no = siren + location
  org_no + luhn_check(org_no).to_s
end
suffix() click to toggle source
# File lib/ffaker/company_fr.rb, line 18
def suffix
  fetch_sample(SUFFIXES)
end