Skip to content

Instantly share code, notes, and snippets.

View samuel-sflima's full-sized avatar

Samuel Lima samuel-sflima

View GitHub Profile
@lucascaton
lucascaton / cpf_cnpj_validators.rb
Created July 27, 2011 14:40 — forked from gouvermxt/cpf_cnpj_validators.rb
validação de CPF e CNPJ em Ruby
#------------------------------------------------------------------------------
# Rotinas para verificação de CPF e CNPJ
# Linguagem: Ruby
# Escrito por: André Camargo < andre@boaideia.inf.br > http://blog.boaideia.inf.br
# Use, copie, melhore a vontade! Patches são bem-vindos...
#------------------------------------------------------------------------------
def check_cpf(cpf=nil)
return false if cpf.nil?
nulos = %w{12345678909 11111111111 22222222222 33333333333 44444444444 55555555555 66666666666 77777777777 88888888888 99999999999 00000000000}