cnes 0.1.0 → 1.0.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 +4 -4
- data/lib/cnes/servicos/profissionais.rb +5 -3
- data/lib/cnes/version.rb +1 -1
- data/lib/cnes.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1ecc74fdbcd27f4de6fb7b49e8dcee05c83ecb123053586abf930e3f2e2ff01
|
4
|
+
data.tar.gz: 1dedc072ca68b873626d792fa05783b58f034c8e32e0fe07416a3a0676d018dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '09bc33b6be72fe5f5e0b10292edac1c555a3e96c7b0af64a7e321fa40d929123a8a62f07493d646ee255439a84fcb4b59287788089cee985924535484df5becc'
|
7
|
+
data.tar.gz: 2ed0c0988b18689ff9ef6b07b75bf51f8de750736aff7f34249848250437270a2f2d4c93eb72a29f77782e4f883b3bdad8ea0f12e8a26c16b1dfaea9eced40a5
|
@@ -23,7 +23,7 @@ module Cnes
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
raise "Estado não
|
26
|
+
raise InvalidArgumentError, "Estado não encontrado: #{estado}"
|
27
27
|
end
|
28
28
|
|
29
29
|
def cidade_id(cidade, estado_id:)
|
@@ -33,13 +33,15 @@ module Cnes
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
-
raise "Cidade não
|
36
|
+
raise InvalidArgumentError, "Cidade não encontrada: #{cidade}"
|
37
37
|
end
|
38
38
|
|
39
39
|
def estabelecimento_id(estabelecimento, cidade_id:)
|
40
40
|
results = @client.estabelecimentos(municipio: cidade_id, nome: estabelecimento)
|
41
41
|
first = results.first || {}
|
42
|
-
first.fetch('id')
|
42
|
+
first.fetch('id') do
|
43
|
+
raise InvalidArgumentError, "Estabelecimento não encontrado: #{estabelecimento}"
|
44
|
+
end
|
43
45
|
end
|
44
46
|
end
|
45
47
|
end
|
data/lib/cnes/version.rb
CHANGED
data/lib/cnes.rb
CHANGED