cep_facil 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -9,14 +9,12 @@ Installation
9
9
  In the `Gemfile`
10
10
 
11
11
  ```ruby
12
-
13
- gem `cep_facil`
14
-
12
+ gem "cep_facil"
15
13
  ```
16
14
 
17
15
  Or via RubyGems, directly:
18
16
 
19
- gem install cep_facil
17
+ `gem install cep_facil`
20
18
 
21
19
 
22
20
  Usage
@@ -38,16 +36,21 @@ There are three formats for one to store Brazilian zip codes (CEPS):
38
36
 
39
37
  * "12345-678"
40
38
  * "12345678"
41
- * 12345678 # Don't use this one, really.
39
+ * 12345678 # I wouldn't use this one, really.
42
40
 
43
41
  CepFácil works with the three of them.
44
42
 
45
- AUTHOR
43
+ Author
46
44
  ------
47
45
 
48
46
  * Rodrigo Vieira - rodrigovieira1994@gmail.com - http://www.rodrigoalvesvieira.com
49
47
 
50
- LICENCE
48
+ Thanks
49
+ -------
50
+
51
+ Huge thanks and cheers to CépFácil (http://cepfacil.com.br) of course. Thanks for the great service that you provide!
52
+
53
+ Licence
51
54
  -------
52
55
 
53
56
  Copyright (c) 2012 Rodrigo Vieira. http://www.rodrigoalvesvieira.com/
@@ -1,3 +1,3 @@
1
1
  module CepFacil
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/cep_facil.rb CHANGED
@@ -3,21 +3,21 @@ require "cep_facil/version"
3
3
  require "net/http"
4
4
 
5
5
  module CepFacil
6
-
7
- # Recebe o CEP e o Token (obtenha o seu em http://cepfacil.com.br) e
8
- # retorna o endereço reference ao CEP passado.
6
+
7
+ # Receives the zip code (CEP) and the Token (get yours at http://cepfacil.com.br) and
8
+ # returns the address referent to that zip code as a hash object.
9
9
  #
10
10
  # == Exemplo
11
11
  # require "cep_facil"
12
12
  # cep = "5417-540"
13
13
  # token = "1234567890"
14
- # CepFacil.get_address(cep, token)
15
- # Retorna o endereço daquele cep em forma de Hash.
16
- # Esse hash tem 6 chaves: cep, type, state, city, neighborhood, description
17
-
18
- # Algumas pessoas guardam o CEP na forma "22222222", outras como "22222-222"
19
- # outras até como inteiro.
20
- # O método CepFacil.get_address aceita as três formas.
14
+ # address = CepFacil.get_address(cep, token)
15
+ # address is a hash with 6 keys: cep, type, state, city, neighborhood, description
16
+ # Reading them:
17
+ # address[:city]
18
+ # address[:state]
19
+ # Some applications store Brazilian zip codes (CEPs) in formats like "22222222", or "22222-222"
20
+ # or even as an integer. This method accept these three possible formats so you don´t need to format it yourself.
21
21
 
22
22
  def self.get_address(zip_code, token)
23
23
  zip_code = zip_code.to_s
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cep_facil
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-02 00:00:00.000000000 Z
12
+ date: 2012-01-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70128918947180 !ruby/object:Gem::Requirement
16
+ requirement: &70231872781820 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '2'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70128918947180
24
+ version_requirements: *70231872781820
25
25
  description: Wrapper Ruby para o serviço cepfacil.com.br
26
26
  email:
27
27
  - rodrigo@atela.com.br