Module: FFaker::Education

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

Constant Summary collapse

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).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

Methods included from ModuleUtils

const_missing, k, underscore

Methods included from RandomUtils

#fetch_sample, #rand, #shuffle

Instance Method Details

#degreeObject



18
19
20
# File 'lib/ffaker/education.rb', line 18

def degree
  "#{fetch_sample(DEGREE_PREFIX)} in #{major}"
end

#degree_shortObject



14
15
16
# File 'lib/ffaker/education.rb', line 14

def degree_short
  "#{fetch_sample(DEGREE_SHORT_PREFIX)} in #{major}"
end

#majorObject



22
23
24
# File 'lib/ffaker/education.rb', line 22

def major
  "#{fetch_sample(MAJOR_ADJ)} #{fetch_sample(MAJOR_NOUN)}"
end

#schoolObject



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

def school
  case rand(5)
  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_nameObject



30
31
32
33
34
35
# File 'lib/ffaker/education.rb', line 30

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

#school_nameObject



26
27
28
# File 'lib/ffaker/education.rb', line 26

def school_name
  fetch_sample(SCHOOL_PREFIX) + fetch_sample(SCHOOL_SUFFIX)
end