Class: BrFaker::Cpf

Inherits:
Object
  • Object
show all
Extended by:
CpfCnpj
Defined in:
lib/brfaker/cpf_cnpj/cpf.rb

Constant Summary

Constants included from CpfCnpj

BrFaker::CpfCnpj::CNPJ_MASK, BrFaker::CpfCnpj::CPF_MASK

Class Method Summary collapse

Class Method Details

.cpf(mask = true) ⇒ Object



8
9
10
11
12
# File 'lib/brfaker/cpf_cnpj/cpf.rb', line 8

def cpf(mask=true)
  number = generate_number(9, [10, 11])        
  return number unless mask
  number.apply_mask(CPF_MASK)
end