egov_utils 1.5.0.alpha15 → 1.5.0.alpha16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15decb855085e1518023c890a8a343280b58192d4905cb9e1d34111d2ee77210
4
- data.tar.gz: c5e5a7c0776a6c9d8e6d8e1a77b4feb0b08c0abb8fec132863555854a2364bd3
3
+ metadata.gz: 42577786177c1af8817f136fe3f860c925d2cd91540f49e17dc11b2fe3635397
4
+ data.tar.gz: fbb299d6905f40c3102c22cb28403ff3c5c0ffd032fb1de7934d30de40c3bf92
5
5
  SHA512:
6
- metadata.gz: 63cc51cbdafcfc670664645fe4cc8c561da44d0ee78506d3940dc9b1c7d5c24c81d9e72d91f97db6765947279f0c63dca1e945d9b2e23dfb725ef19006638f0d
7
- data.tar.gz: 42102169cc95fb945187fac0990107399d078fffd5ebfcd60be1417dc03c3f02d0a560e33a5b0981521c1067c2977633e27d8bfe979a1aedbf4f50b18dfa3738
6
+ metadata.gz: 966c54f84cf6b291350dc61a80369541fef8dc322346d2c4fffef384a07cfd37ae74a30165ab626e8d538168927f50ec79cbfb29656c7f964dd7f21c575f037a
7
+ data.tar.gz: d315fe2d9a406873884bf5a3d88970b843653bf9fa5ce6254851f79fe83947e2b73b95a3bb76700d928d95606079823b92242d26ae7faea646294128e8ccd892
@@ -40,9 +40,18 @@ module EgovUtils
40
40
  end
41
41
  end
42
42
 
43
+ def invalid_record_code
44
+ return @invalid_record_code if defined?(@invalid_record_code)
45
+
46
+ @invalid_record_code =
47
+ if response_body.xpath('//NarozeniSvet').text.present?
48
+ 'not_found'
49
+ end
50
+ end
51
+
43
52
  def handle_response!
44
- if internal_error_code
45
- errors.add(:base, internal_error_code)
53
+ if internal_error_code || invalid_record_code
54
+ errors.add(:base, internal_error_code || invalid_record_code)
46
55
  return
47
56
  end
48
57
 
@@ -50,7 +59,7 @@ module EgovUtils
50
59
  firstname: response_body.xpath('//Jmeno').text.capitalize,
51
60
  lastname: response_body.xpath('//Prijmeni').text.capitalize,
52
61
  birth_date: response_body.xpath('//DatumNarozeni').text,
53
- birth_place: response_body.xpath('//Lokalita/Nazev').text,
62
+ birth_place: response_body.xpath('//Lokalita/Nazev').text.presence,
54
63
  remote_id: response_body.xpath('//GlobalniAifo').text
55
64
  )
56
65
  end
@@ -1,3 +1,3 @@
1
1
  module EgovUtils
2
- VERSION = '1.5.0.alpha15'
2
+ VERSION = '1.5.0.alpha16'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: egov_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0.alpha15
4
+ version: 1.5.0.alpha16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ondřej Ezr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-14 00:00:00.000000000 Z
11
+ date: 2024-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -941,7 +941,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
941
941
  - !ruby/object:Gem::Version
942
942
  version: '0'
943
943
  requirements: []
944
- rubygems_version: 3.5.16
944
+ rubygems_version: 3.5.22
945
945
  signing_key:
946
946
  specification_version: 4
947
947
  summary: The eGoverment utilities is set of functionalities to support basic eGoverment