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::Business #1852

Merged
merged 1 commit into from Dec 5, 2019
Merged
Changes from all commits
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
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