Sha256: 3d2daef7daefdac3a0e0e6ea0badc20dd655bef5c7208897e9d58d7f8f140451

Contents?: true

Size: 999 Bytes

Versions: 1

Compression:

Stored size: 999 Bytes

Contents

# frozen_string_literal: true

module FFakerTW
  module NameNL
    include FFakerTW::Name

    extend ModuleUtils
    extend self

    PREFIXES = %w[Dr. Drs. Ir. Ing. Prof.].freeze

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

    def first_name
      case rand(0..1)
      when 0 then first_name_female
      when 1 then first_name_male
      end
    end

    def first_name_female
      case rand(0..7)
      when 0 then [fetch_sample(FIRST_NAMES_FEMALE), fetch_sample(FIRST_NAMES_FEMALE)].join('-')
      else fetch_sample(FIRST_NAMES_FEMALE)
      end
    end

    def first_name_male
      case rand(0..7)
      when 0 then [fetch_sample(FIRST_NAMES_MALE), fetch_sample(FIRST_NAMES_MALE)].join('-')
      else fetch_sample(FIRST_NAMES_MALE)
      end
    end

    def last_name
      fetch_sample(LAST_NAMES)
    end

    def prefix
      fetch_sample(PREFIXES)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ffakerTW-0.1.0 lib/ffakerTW/name_nl.rb