class Faker::IDNumber

Constants

INVALID_SSN

Public Class Methods

invalid() click to toggle source
# File lib/faker/id_number.rb, line 18
def invalid
  _translate('invalid')
end
ssn_valid() click to toggle source
# File lib/faker/id_number.rb, line 22
def ssn_valid
  ssn = regexify(/[0-8]\d{2}-\d{2}-\d{4}/)
  # We could still have all 0s in one segment or another
  INVALID_SSN.any? { |regex| regex =~ ssn } ? ssn_valid : ssn
end
valid() click to toggle source
# File lib/faker/id_number.rb, line 14
def valid
  _translate('valid')
end

Private Class Methods

_translate(key) click to toggle source
# File lib/faker/id_number.rb, line 30
def _translate(key)
  parse("id_number.#{key}")
end