Module: Faker::Education
- Extended by:
- Education, ModuleUtils
- Included in:
- Education
- Defined in:
- lib/ffaker/education.rb
Constant Summary
- 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'])
- MAJOR_NOUN =
k %w(Science Arts Administration Engineering Management Production Economics Architecture Accountancy Education Development Philosophy Studies)
- SCHOOL_PREFIX =
k %w(Green South North Wind Lake Hill Lark River Red White)
- SCHOOL_SUFFIX =
k %w(wood dale ridge ville point field shire shore crest spur well side coast)
- 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)
- - (Object) degree
- - (Object) degree_short
- - (Object) major
- - (Object) school
- - (Object) school_generic_name
- - (Object) school_name
Methods included from ModuleUtils
Instance Method Details
- (Object) degree
10 11 12 |
# File 'lib/ffaker/education.rb', line 10 def degree "#{DEGREE_PREFIX.rand} in #{major}" end |
- (Object) degree_short
6 7 8 |
# File 'lib/ffaker/education.rb', line 6 def degree_short "#{DEGREE_SHORT_PREFIX.rand} in #{major}" end |
- (Object) major
14 15 16 |
# File 'lib/ffaker/education.rb', line 14 def major "#{MAJOR_ADJ.rand} #{MAJOR_NOUN.rand}" end |
- (Object) school
29 30 31 32 33 34 35 36 |
# File 'lib/ffaker/education.rb', line 29 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 |
- (Object) school_generic_name
22 23 24 25 26 27 |
# File 'lib/ffaker/education.rb', line 22 def school_generic_name case rand(2) when 0 then AddressUS::STATE.rand when 1 then school_name end end |
- (Object) school_name
18 19 20 |
# File 'lib/ffaker/education.rb', line 18 def school_name SCHOOL_PREFIX.rand + SCHOOL_SUFFIX.rand end |