teryt 0.1.0 → 0.1.2

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: 12c993ed8f9a67e5c5924021b35c1b768d91990866d6df867453212ef63612fb
4
- data.tar.gz: 55cfd39997f96791ddd86e22323b1c979eac8dce196cc84abb616d38203a1b6d
3
+ metadata.gz: 955c36441e30f9e96f3e8e129ffd46b413b44d0ead344c61dfed5ac3109b9da4
4
+ data.tar.gz: c2286e6bc9b6673d98dd8f5821db55fdbf17fe88a3e8821a0d634ddb5819e84c
5
5
  SHA512:
6
- metadata.gz: 9d0f72796f82b6e964ad061064b796272edc0250bc4e2fb1f4500da70b4c786d7716f09cf704849531117524d851c5f307087de03231731f6d459bc3805c6d42
7
- data.tar.gz: 5bce38518b61e31d23a5b26f827363ce1df1a501dfe30a453efd627e99efb742e4ada2f4c4c448649422f7f2ae6079dffa03cd95d7176e6cc92ad664bd0af623
6
+ metadata.gz: 5623164af004403ceea304bdc4f516fbaf406366fbd73ce55b781b5c565b5c8d79086f6c2ed48f9ec967b390862100196c8b93c7df8dfd52d196bdb14548e7bb
7
+ data.tar.gz: 4c46ee78b79abb000f6d983fd916715d97ae48b99f2e2b0e19a95caf0e3ada75ec87a14761d53a2bc62a47641c495e44eb7f46badb9250a3ea023016f2f362e9
data/lib/teryt/client.rb CHANGED
@@ -26,8 +26,28 @@ module Teryt
26
26
  .map { |attrs| JednostkaTerytorialna.new(**attrs) }
27
27
  end
28
28
 
29
- def pobierz_liste_powiatow(woj: "", data_stanu: Date.today)
30
- savon_client.call(:pobierz_liste_powiatow, message: { "tns:DataStanu" => data_stanu })
29
+ def pobierz_liste_powiatow(woj:, data_stanu: Date.today)
30
+ savon_client
31
+ .call(:pobierz_liste_powiatow, message: { "tns:Woj" => woj, "tns:DataStanu" => data_stanu })
32
+ .to_hash
33
+ .dig(:pobierz_liste_powiatow_response, :pobierz_liste_powiatow_result, :jednostka_terytorialna)
34
+ .map { |attrs| JednostkaTerytorialna.new(**attrs) }
35
+ end
36
+
37
+ def pobierz_liste_gmin(woj:, pow:, data_stanu: Date.today)
38
+ savon_client
39
+ .call(:pobierz_liste_gmin, message: { "tns:Woj" => woj, "tns:Pow" => pow, "tns:DataStanu" => data_stanu })
40
+ .to_hash
41
+ .dig(:pobierz_liste_gmin_response, :pobierz_liste_gmin_result, :jednostka_terytorialna)
42
+ .then { |result| Array.wrap(result) }
43
+ .map { |attrs| JednostkaTerytorialna.new(**attrs) }
44
+ end
45
+
46
+ def pobierz_slownik_rodzajow_jednostek
47
+ savon_client
48
+ .call(:pobierz_slownik_rodzajow_jednostek, message: {})
49
+ .to_hash
50
+ .dig(:pobierz_slownik_rodzajow_jednostek_response, :pobierz_slownik_rodzajow_jednostek_result, :string)
31
51
  end
32
52
  end
33
53
  end
data/lib/teryt/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Teryt
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.2"
5
5
  end
data/teryt-0.1.0.gem ADDED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: teryt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcin Doliwa
@@ -41,6 +41,7 @@ files:
41
41
  - lib/teryt/jednostka_terytorialna.rb
42
42
  - lib/teryt/version.rb
43
43
  - sig/teryt.rbs
44
+ - teryt-0.1.0.gem
44
45
  - teryt.gemspec
45
46
  homepage: https://github.com/mdoliwa/teryt
46
47
  licenses: