Module: Faker::Education

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

Constant Summary collapse

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

Instance Method Summary collapse

Methods included from ModuleUtils

const_missing, k, underscore

Instance Method Details

#degreeObject



12
13
14
# File 'lib/ffakerer/education.rb', line 12

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

#degree_shortObject



8
9
10
# File 'lib/ffakerer/education.rb', line 8

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

#majorObject



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

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

#schoolObject



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

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

#school_generic_nameObject



24
25
26
27
28
29
# File 'lib/ffakerer/education.rb', line 24

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

#school_nameObject



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

def school_name
  SCHOOL_PREFIX.rand + SCHOOL_SUFFIX.rand
end