fhir_models 4.2.1 → 4.2.2

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: fadfd93d541495ffb2bef389e4f453b21463a56c9f50c39f8e894ee81ef039f8
4
- data.tar.gz: 908a52232f3717ff22589707738e59f73276865c49d71a8eec31b9725b9fb623
3
+ metadata.gz: 1519a66581a704c52e44ce3aa98f23528fe691ecf3af22bce5b0eaa8b45af05f
4
+ data.tar.gz: ed8c1093325205391c68b9f71ab81e2c80d6515660aaf59e4d51bbf4ebd80ba0
5
5
  SHA512:
6
- metadata.gz: 333c284cada44d2ad27f70a66c0991f80143c53980d6c7cb11d15fbae54f7d28d8d8a6bed9bc12b268469e7f1cca950a9ddb961781bc762458d56db0d64ecfc1
7
- data.tar.gz: e4cc9532a0a4f5c22194a6042a70adac2eeb54e8993704d81d1fd36988f106f3d3bf6e33e3eb55203d03099ea3ca3c7624ebe7ee3adc461b15f972b2f9875bed
6
+ metadata.gz: 886b58b3631c5a7ba06f10b40f5721d12ededddc20ad692b830c88a1ea370e635fe6dae144ec90746588fc33415045936aed6f04cc803a1ec3275751d615caab
7
+ data.tar.gz: 2f29ad97d1f8b68a3f7e3631d7e06d6656982eff5efff162f560cd7dc715860c6d6a46d7f86b8da606bbf0e61dcec89eb80a5c732c26489c690d24d95b037939
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fhir_models (4.2.1)
4
+ fhir_models (4.2.2)
5
5
  bcp47 (>= 0.3)
6
6
  date_time_precision (>= 0.8)
7
7
  mime-types (>= 3.0)
@@ -14,7 +14,7 @@ GEM
14
14
  bcp47 (0.3.3)
15
15
  i18n
16
16
  coderay (1.1.3)
17
- concurrent-ruby (1.1.9)
17
+ concurrent-ruby (1.1.10)
18
18
  coolline (0.5.0)
19
19
  unicode_utils (~> 1.4)
20
20
  date_time_precision (0.8.1)
@@ -39,7 +39,7 @@ GEM
39
39
  guard-test (2.0.8)
40
40
  guard-compat (~> 1.2)
41
41
  test-unit (~> 3.0)
42
- i18n (1.8.10)
42
+ i18n (1.12.0)
43
43
  concurrent-ruby (~> 1.0)
44
44
  jaro_winkler (1.5.4)
45
45
  json (2.3.1)
@@ -48,9 +48,9 @@ GEM
48
48
  rb-inotify (~> 0.9, >= 0.9.10)
49
49
  lumberjack (1.2.8)
50
50
  method_source (1.0.0)
51
- mime-types (3.3.1)
51
+ mime-types (3.4.1)
52
52
  mime-types-data (~> 3.2015)
53
- mime-types-data (3.2021.0901)
53
+ mime-types-data (3.2022.0105)
54
54
  mini_portile2 (2.5.3)
55
55
  nenv (0.3.0)
56
56
  nokogiri (1.11.7)
@@ -131,7 +131,7 @@ DEPENDENCIES
131
131
  test-unit
132
132
 
133
133
  RUBY VERSION
134
- ruby 2.5.6p201
134
+ ruby 2.7.4p191
135
135
 
136
136
  BUNDLED WITH
137
137
  2.2.21
@@ -27,23 +27,26 @@ module FHIR
27
27
  blank = ->(obj) { obj.respond_to?(:empty?) ? obj.empty? : obj.nil? }
28
28
  if thing.is_a?(Array)
29
29
  return nil if thing.empty?
30
- thing.map! { |i| prune(i) }
31
- thing.reject!(&blank)
30
+
31
+ thing
32
+ .map { |i| prune(i) }
33
+ .reject(&blank)
32
34
  elsif thing.is_a?(Hash)
33
35
  return {} if thing.empty?
36
+
37
+ new_thing = {}
34
38
  thing.each do |key, value|
35
- thing[key] = prune(value)
36
- end
37
- thing.delete_if do |_key, value|
38
- blank.call(value)
39
+ new_thing[key] = prune(value) unless blank.call(value)
39
40
  end
41
+ new_thing
42
+ else
43
+ thing
40
44
  end
41
- thing
42
45
  end
43
46
 
44
- def from_hash(hash)
47
+ def from_hash(original_hash)
45
48
  # eliminate empty stuff
46
- hash = prune(hash) unless hash.empty?
49
+ pruned_hash = prune(original_hash) unless original_hash.empty?
47
50
  # clear the existing variables
48
51
  self.class::METADATA.each do |key, value|
49
52
  local_name = key
@@ -51,7 +54,8 @@ module FHIR
51
54
  instance_variable_set("@#{local_name}", nil)
52
55
  end
53
56
  # set the variables to the hash values
54
- hash.each do |key, value|
57
+ pruned_hash&.each_key do |key|
58
+ value = original_hash[key]
55
59
  key = key.to_s
56
60
  meta = self.class::METADATA[key]
57
61
  next if meta.nil?
@@ -1,5 +1,5 @@
1
1
  module FHIR
2
2
  module Models
3
- VERSION = '4.2.1'.freeze
3
+ VERSION = '4.2.2'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fhir_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.1
4
+ version: 4.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Walonoski
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: exe
14
14
  cert_chain: []
15
- date: 2021-09-23 00:00:00.000000000 Z
15
+ date: 2022-09-12 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: nokogiri