Module: FFaker::NamePL

Extended by:
ModuleUtils, NamePL
Included in:
NamePL
Defined in:
lib/ffaker/name_pl.rb

Overview

Constant Summary collapse

GENDERS =
%i[random female male].freeze
MALE_PREFIXES =
%w[Pan].freeze
FEMALE_PREFIXES =
%w[Pani].freeze
ACADEMIC_DEGREE_PREFIXES =
['lic.', 'inż.', 'mgr', 'mgr inż.', 'dr', 'dr hab.', 'prof.'].freeze
PREFIXES =
(MALE_PREFIXES + FEMALE_PREFIXES + ACADEMIC_DEGREE_PREFIXES).freeze

Instance Method Summary collapse

Methods included from ModuleUtils

const_missing, k, luhn_check, underscore, unique

Methods included from RandomUtils

#fetch_sample, #rand, #shuffle

Instance Method Details

#academic_degree_prefixObject



85
86
87
# File 'lib/ffaker/name_pl.rb', line 85

def academic_degree_prefix
  fetch_sample(ACADEMIC_DEGREE_PREFIXES)
end

#female_first_nameObject



57
58
59
# File 'lib/ffaker/name_pl.rb', line 57

def female_first_name
  fetch_sample(FEMALE_FIRST_NAMES)
end

#female_full_nameObject



49
50
51
# File 'lib/ffaker/name_pl.rb', line 49

def female_full_name
  "#{female_first_name} #{female_last_name}"
end

#female_last_nameObject



61
62
63
# File 'lib/ffaker/name_pl.rb', line 61

def female_last_name
  fetch_sample(FEMALE_LAST_NAMES)
end

#female_name_with_prefixObject



41
42
43
# File 'lib/ffaker/name_pl.rb', line 41

def female_name_with_prefix
  "#{female_prefix} #{female_full_name}"
end

#female_prefixObject



77
78
79
# File 'lib/ffaker/name_pl.rb', line 77

def female_prefix
  fetch_sample(FEMALE_PREFIXES)
end

#first_name(gender = :random) ⇒ Object

Generates a random first name for a given gender (random by default). Acceptable gender values: :random, :female, :male



37
38
39
# File 'lib/ffaker/name_pl.rb', line 37

def first_name(gender = :random)
  name_for_gender(:first_name, gender)
end

#last_name(gender = :random) ⇒ Object

Generates a random last name for a given gender (random by default). Acceptable gender values: :random, :female, :male



31
32
33
# File 'lib/ffaker/name_pl.rb', line 31

def last_name(gender = :random)
  name_for_gender(:last_name, gender)
end

#male_first_nameObject



65
66
67
# File 'lib/ffaker/name_pl.rb', line 65

def male_first_name
  fetch_sample(MALE_FIRST_NAMES)
end

#male_full_nameObject



53
54
55
# File 'lib/ffaker/name_pl.rb', line 53

def male_full_name
  "#{male_first_name} #{male_last_name}"
end

#male_last_nameObject



69
70
71
# File 'lib/ffaker/name_pl.rb', line 69

def male_last_name
  fetch_sample(MALE_LAST_NAMES)
end

#male_name_with_prefixObject



45
46
47
# File 'lib/ffaker/name_pl.rb', line 45

def male_name_with_prefix
  "#{male_prefix} #{male_full_name}"
end

#male_prefixObject



81
82
83
# File 'lib/ffaker/name_pl.rb', line 81

def male_prefix
  fetch_sample(MALE_PREFIXES)
end

#name(gender = :random) ⇒ Object Also known as: full_name

Generates a random full name for a given gender (random by default). Acceptable gender values: :random, :female, :male



19
20
21
# File 'lib/ffaker/name_pl.rb', line 19

def name(gender = :random)
  name_for_gender(:full_name, gender)
end

#name_with_prefix(gender = :random) ⇒ Object



25
26
27
# File 'lib/ffaker/name_pl.rb', line 25

def name_with_prefix(gender = :random)
  name_for_gender(:name_with_prefix, gender)
end

#prefixObject



73
74
75
# File 'lib/ffaker/name_pl.rb', line 73

def prefix
  fetch_sample(PREFIXES)
end