Skip to content

Commit

Permalink
Add YARD docs for Faker::Business. (faker-ruby#1852)
Browse files Browse the repository at this point in the history
  • Loading branch information
connorshea authored and vbrazo committed Dec 5, 2019
1 parent 7f8f756 commit e6ca063
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions lib/faker/default/business.rb
Expand Up @@ -7,14 +7,41 @@ class Business < Base
flexible :business

class << self
##
# Produces a credit card number.
#
# @return [String]
#
# @example
# Faker::Business.credit_card_number #=> "1228-1221-1221-1431"
#
# @faker.version 1.2.0
def credit_card_number
fetch('business.credit_card_numbers')
end

##
# Produces a credit card expiration date.
#
# @return [Date]
#
# @example
# Faker::Business.credit_card_number #=> <Date: 2015-11-11 ((2457338j,0s,0n),+0s,2299161j)>
#
# @faker.version 1.2.0
def credit_card_expiry_date
::Date.today + (365 * rand(1..4))
end

##
# Produces a type of credit card.
#
# @return [String]
#
# @example
# Faker::Business.credit_card_type #=> "visa"
#
# @faker.version 1.2.0
def credit_card_type
fetch('business.credit_card_types')
end
Expand Down

0 comments on commit e6ca063

Please sign in to comment.