Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add YARD docs to Faker::University #1959

Merged
merged 1 commit into from
May 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
45 changes: 45 additions & 0 deletions lib/faker/default/university.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,67 @@ class University < Base
flexible :university

class << self
##
# Produces a random university name
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a period at the end of the sentence?

Suggested change
# Produces a random university name
# Produces a random university name.

The same applies to the other sentences in this PR.

#
# @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 Ψ Ω]
Expand Down