diff --git a/lib/faker/default/relationship.rb b/lib/faker/default/relationship.rb index 4134723876..fadea00e78 100644 --- a/lib/faker/default/relationship.rb +++ b/lib/faker/default/relationship.rb @@ -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 @@ -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