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 Faker::Relationship YARD docs #1793

Merged
merged 7 commits into from Nov 13, 2019
Merged
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/relationship.rb
Expand Up @@ -5,6 +5,15 @@ class Relationship < Base
flexible :relationship

class << self
##
# Produces a random family relationship.
#
# @return [String]
#
# @example
# Faker::Relationship.familial #=> "Grandfather"
#
# @faker.version next
ashishra0 marked this conversation as resolved.
Show resolved Hide resolved
def familial(legacy_connection = NOT_GIVEN, connection: nil)
warn_for_deprecated_arguments do |keywords|
keywords << :connection if legacy_connection != NOT_GIVEN
Expand All @@ -26,18 +35,54 @@ def familial(legacy_connection = NOT_GIVEN, connection: nil)
fetch('relationship.familial.' + connection)
end

##
# Produces a random in-law relationship .
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
# Produces a random in-law relationship .
# Produces a random in-law relationship.

#
# @return [String]
#
# @example
# Faker::Relationship.in_law #=> "Brother-in-law"
#
# @faker.version next
def in_law
fetch('relationship.in_law')
end

##
# Produces a random spouse relationship.
#
# @return [String]
#
# @example
# Faker::Relationship.spouse #=> "Husband"
#
# @faker.version next
def spouse
fetch('relationship.spouse')
end

##
# Produces a random parent relationship.
#
# @return [String]
#
# @example
# Faker::Relationship.parent #=> "Father"
#
# @faker.version next
def parent
fetch('relationship.parent')
end

##
# Produces a random sibling relationship.
#
# @return [String]
#
# @example
# Faker::Relationship.sibling #=> "Sister"
#
# @faker.version next
def sibling
fetch('relationship.sibling')
end
Expand Down