Module: FFaker::NameIT

Extended by:
ModuleUtils, NameIT
Included in:
NameIT
Defined in:
lib/ffaker/name_it.rb

Constant Summary collapse

PREFIX =
%w[Sig. Sig.ra Sig.na Dr. Dott. Dott.ssa Prof. Prof.ssa].freeze

Instance Method Summary collapse

Methods included from ModuleUtils

const_missing, k, underscore, unique

Methods included from RandomUtils

#fetch_sample, #rand, #shuffle

Instance Method Details

#first_nameObject


20
21
22
# File 'lib/ffaker/name_it.rb', line 20

def first_name
  fetch_sample(FIRST_NAMES)
end

#last_nameObject


16
17
18
# File 'lib/ffaker/name_it.rb', line 16

def last_name
  fetch_sample(LAST_NAMES)
end

#nameObject


24
25
26
27
28
29
# File 'lib/ffaker/name_it.rb', line 24

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

#prefixObject

randomized? (ITALIAN) prefix!


12
13
14
# File 'lib/ffaker/name_it.rb', line 12

def prefix
  fetch_sample(PREFIX)
end