diff --git a/.rubocop.yml b/.rubocop.yml index 134857ec27..639c729545 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -40,6 +40,11 @@ Metrics/PerceivedComplexity: Enabled: false Max: 7 +Style/AsciiComments: + Description: This cop checks for non-ascii (non-English) characters in comments. + Exclude: + - 'lib/faker/default/university.rb' + Style/DateTime: Description: This cop checks for consistent usage of the DateTime class over the Time class. Enabled: false diff --git a/lib/faker/default/university.rb b/lib/faker/default/university.rb index 2aabd1e41d..cdb249bd05 100644 --- a/lib/faker/default/university.rb +++ b/lib/faker/default/university.rb @@ -5,22 +5,67 @@ class University < Base flexible :university class << self + ## + # Produces a random university name + # + # @return [String] + # + # @example + # Faker::University.name #=> "Eastern Mississippi Academy" + # + # @faker.version 1.5.0 def name parse('university.name') end + ## + # Produces a random university prefix + # + # @return [String] + # + # @example + # Faker::University.prefix #=> "Western" + # + # @faker.version 1.5.0 def prefix fetch('university.prefix') end + ## + # Produces a random university suffix + # + # @return [String] + # + # @example + # Faker::University.suffix #=> "Academy" + # + # @faker.version 1.5.0 def suffix fetch('university.suffix') end + ## + # Produces a random greek organization + # + # @return [String] + # + # @example + # Faker::University.greek_organization #=> "BEX" + # + # @faker.version 1.5.0 def greek_organization Array.new(3) { |_| sample(greek_alphabet) }.join end + ## + # Produces a greek alphabet + # + # @return [Array] + # + # @example + # Faker::University.greek_alphabet #=> ["Α", "B", "Γ", "Δ", ...] + # + # @faker.version 1.5.0 def greek_alphabet %w[Α B Γ Δ E Z H Θ I K Λ M N Ξ O Π P Σ T Y Φ X Ψ Ω]