Class: Faker::University

Inherits:
Base
  • Object
show all
Defined in:
lib/faker/default/university.rb

Constant Summary

Constants inherited from Base

Base::LLetters, Base::Letters, Base::NOT_GIVEN, Base::Numbers, Base::ULetters

Class Method Summary collapse

Methods inherited from Base

bothify, disable_enforce_available_locales, fetch, fetch_all, flexible, generate, letterify, method_missing, numerify, parse, rand, rand_in_range, regexify, resolve, respond_to_missing?, sample, shuffle, translate, unique, with_locale

Class Method Details

.greek_alphabetArray

Produces a greek alphabet.

Examples:

Faker::University.greek_alphabet #=> ["Α", "B", "Γ", "Δ", ...]

Returns:

  • (Array)

Available since:

  • 1.5.0



69
70
71
72
# File 'lib/faker/default/university.rb', line 69

def greek_alphabet
  %w[Α B Γ Δ E Z H Θ I K Λ M N Ξ
     O Π P Σ T Y Φ X Ψ Ω]
end

.greek_organizationString

Produces a random greek organization.

Examples:

Faker::University.greek_organization #=> "BEX"

Returns:

  • (String)

Available since:

  • 1.5.0



56
57
58
# File 'lib/faker/default/university.rb', line 56

def greek_organization
  Array.new(3) { |_| sample(greek_alphabet) }.join
end

.nameString

Produces a random university name.

Examples:

Faker::University.name #=> "Eastern Mississippi Academy"

Returns:

  • (String)

Available since:

  • 1.5.0



17
18
19
# File 'lib/faker/default/university.rb', line 17

def name
  parse('university.name')
end

.prefixString

Produces a random university prefix.

Examples:

Faker::University.prefix #=> "Western"

Returns:

  • (String)

Available since:

  • 1.5.0



30
31
32
# File 'lib/faker/default/university.rb', line 30

def prefix
  fetch('university.prefix')
end

.suffixString

Produces a random university suffix.

Examples:

Faker::University.suffix #=> "Academy"

Returns:

  • (String)

Available since:

  • 1.5.0



43
44
45
# File 'lib/faker/default/university.rb', line 43

def suffix
  fetch('university.suffix')
end