Sha256: 6864a41ee7b17be1b04c91813ed535284f6789e2b9a48e02391f5e72788c0a8c

Contents?: true

Size: 724 Bytes

Versions: 11

Compression:

Stored size: 724 Bytes

Contents

# frozen_string_literal: true

module FFaker
  # The names & first names in this module were found at this url
  # https://github.com/fzaninotto/Faker/blob/master/src/Faker/Provider/fr_FR/Person.php
  module NameFR
    extend ModuleUtils
    extend self

    PREFIX = %w[de du le].freeze

    # randomized? (FRENCH)  prefix!
    #
    def prefix
      fetch_sample(PREFIX)
    end

    def last_name
      fetch_sample(LAST_NAMES)
    end

    def first_name
      fetch_sample(FIRST_NAMES)
    end

    def name
      case rand(0..9)
      when 7 then "#{first_name} #{prefix} #{last_name}"
      when 5 then "#{first_name} #{prefix} #{last_name}"
      else        "#{first_name} #{last_name}"
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
ffaker-2.22.0 lib/ffaker/name_fr.rb
ffaker-2.21.0 lib/ffaker/name_fr.rb
ffaker-2.20.0 lib/ffaker/name_fr.rb
ffaker-2.19.0 lib/ffaker/name_fr.rb
ffaker-2.18.0 lib/ffaker/name_fr.rb
ffaker-2.17.0 lib/ffaker/name_fr.rb
ffaker-2.16.0 lib/ffaker/name_fr.rb
ffaker-2.15.0 lib/ffaker/name_fr.rb
ffaker-2.14.0 lib/ffaker/name_fr.rb
ffaker-2.13.0 lib/ffaker/name_fr.rb
ffaker-2.12.0 lib/ffaker/name_fr.rb