Project

cep_brasil

0.0
No commit activity in last 3 years
No release in over 3 years
Generates a random CEP from brazilian´s zip code
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.0
~> 13.0
~> 3.0
 Project Readme

CepBrasil

This gem was created to make my applications tests more easy. I will update soon and I'll be happy if you want to help me

Installation

To start using, just add this line to your application's Gemfile:

gem 'cep_brasil'

And then execute:

$ bundle

Or install it yourself as:

$ gem install cep_brasil

Usage

In your application, require using require 'cep_brasil'

Example of usage:

require 'cep_brasil'


#Generates a Random CEP

CepBrasil::Random.generate_formatted #=> "010050-101"

or

CepBrasil::Random.generate_formatted('12345678') #=> "12345-678"

#Create a address object by pass a CEP and content type, ex: json, xml

endereco = CepBrasil::Address::Generate.new('01001001', 'json') #=> "<Address Object>"
endereco.cep #=> "010050-101"
endereco.logradouro #=> "Praça da Sé"

## The random generates not necessarily generates a valid cep, it´s recomend to using in tests
## The Address object with valid cep build a valid address

Development

Any suggestions or help are welcome :)

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/cep_brasil. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.