Skip to content

Instantly share code, notes, and snippets.

View lohhans's full-sized avatar
:octocat:
Slapping the keyboard until something good happens.

Armstrong Lohãns lohhans

:octocat:
Slapping the keyboard until something good happens.
View GitHub Profile
@gouvermxt
gouvermxt / cpf_cnpj_validators.rb
Created June 3, 2011 00:39
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}