Skip to content

Commit

Permalink
add Faker::Relationship YARD docs (faker-ruby#1793)
Browse files Browse the repository at this point in the history
* add Faker::Relationship YARD docs

* Update lib/faker/default/relationship.rb

add version 1.9.2

Co-Authored-By: Connor Shea <connor.james.shea@gmail.com>

* add Faker::Relationship YARD docs

* Update lib/faker/default/relationship.rb

add version 1.9.2

Co-Authored-By: Connor Shea <connor.james.shea@gmail.com>

* add faker version as 1.9.2

* remove trailing whitespace
  • Loading branch information
ashishra0 authored and michebble committed Feb 16, 2020
1 parent 22460b0 commit 54d38b7
Showing 1 changed file with 45 additions and 0 deletions.
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 1.9.2
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.
#
# @return [String]
#
# @example
# Faker::Relationship.in_law #=> "Brother-in-law"
#
# @faker.version 1.9.2
def in_law
fetch('relationship.in_law')
end

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

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

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

0 comments on commit 54d38b7

Please sign in to comment.