brasilapi 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ef15edf76d0e1f026aaabd778ec39818a15e997665ce7cc69f141721e5821d7a
4
- data.tar.gz: 87589410fb6001bc5ac7f812093aa06eb05630b76b3740942292db4b9e8f925e
3
+ metadata.gz: 536df4360e01c3daf94486560f9ff29f5ede10005531d18807e5e3a626d3b594
4
+ data.tar.gz: 2966e82aff530a4741b2771a857911cbd2e395bb092b8a810b42f26cb9790b9c
5
5
  SHA512:
6
- metadata.gz: cfb2dc5073d80d5ccd9d15feddd0db36c5d35f94ce1fabd535886ea77cf483a4bbd5762d32008bad52c57dad3230755733061862cc1909f1cc53108e24c1aa70
7
- data.tar.gz: e3ead0c46fb342e224be7a4b488583fa8c2f571c739f4fe445da299a9f13eebc9d282ccadd7e5a0d642c3f3d54e2b0b07defcfea8cc19490e3affa4a7b60fa75
6
+ metadata.gz: 51e3e97bf89cfbda8eeb962734f438228ddfbf10c3d483ff30f78a72168623f9c79bf8f74c80a356a3d6ed30fe728275716db2f3585192874f1860c50668ab8e
7
+ data.tar.gz: 0d2070eefea8846e18b43e16be005cfa561c6099a9746c6a64a8ae4a0e534fc4c137cb527446620b53ac0b6a4466fa82fc9c3de40168221cc1e61fac63d98537
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.3.0] - 2023-10-26
4
+
5
+ - Integração da API de dados relacionados ao DDD
6
+
3
7
  ## [0.2.0] - 2023-10-24
4
8
 
5
9
  - Integração da API de CEP's
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- brasilapi (0.1.1)
4
+ brasilapi (0.3.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -11,7 +11,7 @@ Dependency-less Brasil API lookup gem for brazilian data with an easy-to-use API
11
11
  - [x] **CNPJ**
12
12
  - [ ] **Corretoras**
13
13
  - [ ] **CPTEC**
14
- - [ ] **DDD**
14
+ - [x] **DDD**
15
15
  - [ ] **Feriados Nacionais**
16
16
  - [ ] **FIPE**
17
17
  - [ ] **IBGE**
@@ -56,17 +56,27 @@ BrasilAPI::Company.find_by_cnpj("60316817000103")
56
56
  [{"pais"=>"ESTADOS UNIDOS",
57
57
  ...}
58
58
 
59
- # find address by zip_code
59
+ # find address by zip code
60
60
  BrasilAPI::Address.find_by_zip_code('64001100')
61
61
  => {"cep"=>"64001100", "state"=>"PI", "city"=>"Teresina", "neighborhood"=>"Centro", "street"=>"Praça Pedro II", "service"=>"correios"}
62
62
 
63
- # find address with location by zip_code
63
+ # find address with location by zip code
64
64
  BrasilAPI::Address.find_by_zip_code('80060000', location: true)
65
65
  =>
66
66
  {"cep"=>"80060000",
67
67
  "state"=>"PR",
68
68
  ...
69
69
  "location"=>{"type"=>"Point", "coordinates"=>{"longitude"=>"-49.2614791", "latitude"=>"-25.427253"}}}
70
+
71
+ # get state and cities by area code
72
+ BrasilAPI::Address.state_and_cities_by_area_code('89')
73
+ =>
74
+ {"state"=>"PI",
75
+ "cities"=>
76
+ ["MASSÂPE DO PIAUÍ",
77
+ ...,
78
+ "ACAUÃ"
79
+ ]}
70
80
  ```
71
81
 
72
82
  # License
@@ -8,6 +8,10 @@ module BrasilAPI
8
8
 
9
9
  get("/cep/v1/#{zip_code}")
10
10
  end
11
+
12
+ def state_and_cities_by_area_code(area_code)
13
+ get("/ddd/v1/#{area_code}")
14
+ end
11
15
  end
12
16
  end
13
17
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BrasilAPI
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brasilapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dayvid Emerson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-10-24 00:00:00.000000000 Z
11
+ date: 2023-10-26 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Acesso programático de informações é algo fundamental na comunicação
14
14
  entre sistemas, mas, para nossa surpresa, uma informação tão útil e pública quanto