Skip to content

Commit

Permalink
Add YARD docs to Faker::Finance (#1998)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielTiringer committed May 20, 2020
1 parent d6953cb commit 9ebf001
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions lib/faker/default/finance.rb
Expand Up @@ -7,6 +7,18 @@ class Finance < Base
maestro forbrugsforeningen laser].freeze

class << self
##
# Produces a random credit card number.
#
# @param card_type [String] Specific credit card type.
# @return [String]
#
# @example
# Faker::Finance.credit_card #=> "3018-348979-1853"
# Faker::Finance.credit_card(:mastercard) #=> "6771-8921-2291-6236"
# Faker::Finance.credit_card(:mastercard, :visa) #=> "4448-8934-1277-7195"
#
# @faker.version 1.2.0
def credit_card(*types)
types = CREDIT_CARD_TYPES if types.empty?
type = sample(types)
Expand All @@ -26,6 +38,18 @@ def credit_card(*types)
template.gsub('L', luhn_digit.to_s)
end

##
# Produces a random vat number.
#
# @param country [String] Two capital letter country code to use for the vat number.
# @return [String]
#
# @example
# Faker::Finance.vat_number #=> "BR38.395.329/2471-83"
# Faker::Finance.vat_number('DE') #=> "DE593306671"
# Faker::Finance.vat_number('ZA') #=> "ZA79494416181"
#
# @faker.version 1.9.2
def vat_number(legacy_country = NOT_GIVEN, country: 'BR')
warn_for_deprecated_arguments do |keywords|
keywords << :country if legacy_country != NOT_GIVEN
Expand Down

0 comments on commit 9ebf001

Please sign in to comment.