Module: FFaker::Education
Constant Summary
collapse
- MAJOR_ADJ =
[
'Business', 'Systems', 'Industrial', 'Medical', 'Financial', 'Marketing', 'Political',
'Social', 'Human Resource'
].freeze
- SCHOOL_PREFIX =
%w[Green South North Wind Lake Hill Lark River Red White].freeze
- SCHOOL_ADJ =
%w[International Global Polytechnic National].freeze
- SCHOOL_TYPE =
%w[School University College Institution Academy].freeze
- SCHOOL_UNI =
%w[University College].freeze
Instance Method Summary
collapse
const_missing, k, luhn_check, underscore, unique
#fetch_sample, #rand, #shuffle
Instance Method Details
#degree ⇒ Object
21
22
23
|
# File 'lib/ffaker/education.rb', line 21
def degree
"#{fetch_sample(DEGREE_PREFIX)} in #{major}"
end
|
#degree_short ⇒ Object
17
18
19
|
# File 'lib/ffaker/education.rb', line 17
def degree_short
"#{fetch_sample(DEGREE_SHORT_PREFIX)} in #{major}"
end
|
#major ⇒ Object
25
26
27
|
# File 'lib/ffaker/education.rb', line 25
def major
"#{fetch_sample(MAJOR_ADJ)} #{fetch_sample(MAJOR_NOUN)}"
end
|
#school ⇒ Object
40
41
42
43
44
45
46
47
|
# File 'lib/ffaker/education.rb', line 40
def school
case rand(0..4)
when 0, 1 then "#{school_name} #{fetch_sample(SCHOOL_TYPE)}"
when 2 then "#{school_generic_name} #{fetch_sample(SCHOOL_ADJ)} #{fetch_sample(SCHOOL_TYPE)}"
when 3 then "#{fetch_sample(SCHOOL_UNI)} of #{school_generic_name}"
when 4 then "#{school_generic_name} #{fetch_sample(SCHOOL_TYPE)} of #{fetch_sample(MAJOR_NOUN)}"
end
end
|
#school_generic_name ⇒ Object
33
34
35
36
37
38
|
# File 'lib/ffaker/education.rb', line 33
def school_generic_name
case rand(0..1)
when 0 then fetch_sample(AddressUS::STATE)
when 1 then school_name
end
end
|
#school_name ⇒ Object
29
30
31
|
# File 'lib/ffaker/education.rb', line 29
def school_name
fetch_sample(SCHOOL_PREFIX) + fetch_sample(SCHOOL_SUFFIX)
end
|