cpf_cnpj-crystal

Pair of classes to validate CPF and CNPJ

Build Status

cpf_cnpj

Pair of classes to validate Brazil's CPF and CNPJ

Installation

Add this to your application's shard.yml:

dependencies:
  cpf_cnpj:
    github: CubosTecnologia/cpf_cnpj-crystal

Usage

require "cpf_cnpj"

cpf = CPF.new("182.77702876")
cpf.valid?  # true
cpf.to_s    # "182.777.028-76"

cnpj = CNPJ.new("66.028.218/0001-62")
cnpj.valid?  # true
cnpj.to_s    # "66.028.218/0001-62"

Contributing

  1. Fork it ( https://github.com/CubosTecnologia/cpf_cnpj-crystal/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

Repository

cpf_cnpj-crystal

Owner
Statistic
  • 1
  • 0
  • 0
  • 0
  • 0
  • over 8 years ago
  • June 22, 2016
License

MIT License

Links
Synced at

Sat, 21 Dec 2024 12:28:38 GMT

Languages