Module: FFaker::Education

Extended by:
Education, ModuleUtils
Included in:
Education
Defined in:
lib/ffaker/education.rb

Constant Summary collapse

DEGREE_SHORT_PREFIX =
%w(AB BS BSc MA MD DMus DPhil)
DEGREE_PREFIX =
['Bachelor of Science', 'Bachelor of Arts', 'Master of Arts', 'Doctor of Medicine', 'Bachelor of Music', 'Doctor of Philosophy']
MAJOR_ADJ =
%w(Business Systems Industrial Medical Financial Marketing Political Social) + ['Human Resource']
SCHOOL_PREFIX =
%w(Green South North Wind Lake Hill Lark River Red White)
SCHOOL_ADJ =
%w(International Global Polytechnic National)
SCHOOL_TYPE =
%w(School University College Institution Academy)
SCHOOL_UNI =
%w(University College)

Instance Method Summary collapse

Methods included from ModuleUtils

const_missing, k, underscore

Instance Method Details

#degreeObject



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

def degree
  "#{DEGREE_PREFIX.sample} in #{major}"
end

#degree_shortObject



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

def degree_short
  "#{DEGREE_SHORT_PREFIX.sample} in #{major}"
end

#majorObject



24
25
26
# File 'lib/ffaker/education.rb', line 24

def major
  "#{MAJOR_ADJ.sample} #{MAJOR_NOUN.sample}"
end

#schoolObject



39
40
41
42
43
44
45
46
# File 'lib/ffaker/education.rb', line 39

def school
  case rand(5)
  when (0..1) then "#{school_name} #{SCHOOL_TYPE.sample}"
  when 2 then "#{school_generic_name} #{SCHOOL_ADJ.sample} #{SCHOOL_TYPE.sample}"
  when 3 then "#{SCHOOL_UNI.sample} of #{school_generic_name}"
  when 4 then "#{school_generic_name} #{SCHOOL_TYPE.sample} of #{MAJOR_NOUN.sample}"
  end
end

#school_generic_nameObject



32
33
34
35
36
37
# File 'lib/ffaker/education.rb', line 32

def school_generic_name
  case rand(2)
  when 0 then AddressUS::STATE.sample
  when 1 then school_name
  end
end

#school_nameObject



28
29
30
# File 'lib/ffaker/education.rb', line 28

def school_name
  SCHOOL_PREFIX.sample + SCHOOL_SUFFIX.sample
end