Sha256: 7a9d1413b6dbd59e4db7a3c8d5ac8565e674f491db1f614ad64c1849ced9e944

Contents?: true

Size: 731 Bytes

Versions: 5

Compression:

Stored size: 731 Bytes

Contents

# encoding: utf-8

module Faker
  # Author microspino<info@microspino.com> github.com/microspino
  module NameIT
    extend ModuleUtils
    extend self

    PREFIX = %w(Sig. Sig.ra Sig.na Dr. Dott. Dott.ssa Prof. Prof.ssa)

    # randomized? (ITALIAN)  prefix!
    #
    def prefix
      PREFIX.sample
    end

    def last_name
      LAST_NAMES.sample
    end

    def first_name
      FIRST_NAMES.sample
    end

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

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
solidus_backend-1.0.0.pre3 vendor/bundle/gems/ffaker-1.32.1/lib/ffaker/name_it.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/ffaker-1.32.1/lib/ffaker/name_it.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/ffaker-1.32.1/lib/ffaker/name_it.rb
ffaker-1.32.1 lib/ffaker/name_it.rb
ffaker-1.32.0 lib/ffaker/name_it.rb