Sha256: 1efd0bf564f0efe14178c809e6db9bcb4f058ec9b9707c2c3bd1aee62e31cb35
Contents?: true
Size: 468 Bytes
Versions: 23
Compression:
Stored size: 468 Bytes
Contents
class TaxIdBr attr_reader :document_type, :formatted def initialize tax_id create_document tax_id end def valid? @valid end private def create_document tax_id cpf = CPF.new(tax_id) cnpj = CNPJ.new(tax_id) @valid = true if cpf.valid? @document_type = :cpf @formatted = cpf.formatted elsif cnpj.valid? @document_type = :cnpj @formatted = cnpj.formatted else @valid = false end end end
Version data entries
23 entries across 23 versions & 1 rubygems