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 for Faker:Verb #1916

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
45 changes: 45 additions & 0 deletions lib/faker/default/verb.rb
Expand Up @@ -3,22 +3,67 @@
module Faker
class Verb < Base
class << self
##
# Produces the base form of a verb.
#
# @return [String]
#
# @example
# Faker::Verbs.base #=> "shape"
vbrazo marked this conversation as resolved.
Show resolved Hide resolved
#
# @faker.version 1.9.0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As I couldn't find mention of Faker::Verb in the change logs, I tested this by comparing git blame to release history and then loading versions around that time to see when it became available.

Is this a good way to determine the value for version, or is there a better way?

Copy link
Member

Choose a reason for hiding this comment

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

I usually just search for "Verb" in the GitHub repo and look for the earliest commit(s) mentioning it. You can see all the tags for the commit and the oldest one will be the first version it was included in.

def base
fetch('verbs.base')
end

##
# Produces the past form of a verb.
#
# @return [String]
#
# @example
# Faker::Verbs.past #=> "motivated"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# Faker::Verbs.past #=> "motivated"
# Faker::Verb.past #=> "motivated"

#
# @faker.version 1.9.0
def past
fetch('verbs.past')
end

##
# Produces the past participle form of a verb.
#
# @return [String]
#
# @example
# Faker::Verbs.past_participle #=> "buzzed"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# Faker::Verbs.past_participle #=> "buzzed"
# Faker::Verb.past_participle #=> "buzzed"

#
# @faker.version 1.9.0
def past_participle
fetch('verbs.past_participle')
end

##
# Produces the simple_present form of a verb.
#
# @return [String]
#
# @example
# Faker::Verbs.simple_present #=> "gets"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# Faker::Verbs.simple_present #=> "gets"
# Faker::Verb.simple_present #=> "gets"

#
# @faker.version 1.9.0
def simple_present
fetch('verbs.simple_present')
end

##
# Produces the -ing form of a verb.
#
# @return [String]
#
# @example
# Faker::Verbs.ing_form #=> "climbing"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# Faker::Verbs.ing_form #=> "climbing"
# Faker::Verb.ing_form #=> "climbing"

#
# @faker.version 1.9.0
def ing_form
fetch('verbs.ing_form')
end
Expand Down