datacaster 3.2.3 → 3.2.4

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: f2b45e5271b85a571b86bd83ff91494d68486b677a2f0cc0f03daeeb5e8d5307
4
- data.tar.gz: 7dafa54ec77eee489282217026a845059725a164e381525be695874bbb2cecc3
3
+ metadata.gz: 382b6c6e5194c6746baaef5483ef078a06f0494c1c41798e118bf9b63d554436
4
+ data.tar.gz: 1cc94cf3dbe08b9e660bb0e0a164eaf15567408239fa7b8f84f5353256b6c8b7
5
5
  SHA512:
6
- metadata.gz: 37337520c11d06b98d30e5afcb890b2a8b1bfdbc06f05d070fb8d3c3dc52c4adc9263a9f92a29c0cf92051f5b58c57833f9d1330a8f7cb7fe39a46c2fad694f9
7
- data.tar.gz: 4792f1c3000d5df28c865e5c8c365a87356e8241009b9a7cbe5e55544422c964749ba43e8d6004aba05585a18e1795967dc6c3a22f2e06a03ef87eca0dd4fced
6
+ metadata.gz: a4fc369a63f0a2787d7b7a2706f68cf08a0181771c5c84acb3fa6d60e0f1e2fe2ca097ba611825bfd6e75f344dbf301254d90367cf6ece61264ea29c8b336ea2
7
+ data.tar.gz: caed96fc02c8020c951f053fa2a71852623ff8a45ac9ce91235c34d999b2cebd4eb3533bfdbc090aa561f4346bd596b940bcbd169ea81e47f4756430b87e6ede
@@ -47,7 +47,8 @@ module Datacaster
47
47
  when Hash
48
48
  cast_hash(result, schema)
49
49
  else
50
- raise "Expected hash or array when checking #{value.inspect}"
50
+ raise RuntimeError, "Expected hash or array inside result when checking #{result.inspect} " \
51
+ "(schema is #{schema.inspect})", caller
51
52
  end
52
53
  end
53
54
 
@@ -63,11 +63,8 @@ module Datacaster
63
63
  result = check.with_runtime(runtime).(switch_result)
64
64
  next unless result.valid?
65
65
 
66
- if @pick_key.nil?
67
- return clause.with_runtime(runtime).(object)
68
- else
69
- return runtime.checked_key!(@pick_key) { clause.with_runtime(runtime).(object) }
70
- end
66
+ runtime.checked_key!(@pick_key) if !@pick_key.nil? && !@pick_key.is_a?(Array)
67
+ return clause.with_runtime(runtime).(object)
71
68
  end
72
69
 
73
70
  # all 'on'-s have failed
@@ -1,3 +1,3 @@
1
1
  module Datacaster
2
- VERSION = "3.2.3"
2
+ VERSION = "3.2.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datacaster
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.3
4
+ version: 3.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eugene Zolotarev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-02-06 00:00:00.000000000 Z
11
+ date: 2024-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel