structish 0.2.2 → 0.2.3

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: bc6186c9beb8e254ba551d042cec7933ec6c9fe224f6ff57324f5f21d092f6c9
4
- data.tar.gz: 7ce960425f5a2eab3c9d97d3655ac2947a0c798930d17056a6152d6d6f04c51b
3
+ metadata.gz: 66df6db1a6ad52b3c1c358bebca0618e8956005b37e474ec0c3955921c873b35
4
+ data.tar.gz: e55ffd865eba7a0e876e840e115a947ba6e14bfc930cd129575a906577a73446
5
5
  SHA512:
6
- metadata.gz: d94b5ec90702b92533160ad386d17e61ed182c9d8a15b3e7451c498ae6c275b94a5c3ced3673bc66f8f38e55ffbef6ab70619455a7af0bca0f598c2156376967
7
- data.tar.gz: f019792b357d80d9ceab344922e609448af82caa2edf3b6bda099924ababe08b972eaa7a42f2a41fa0369c77c45b98c9fbf1b205d825af9d9c3f43a09eaaa9a9
6
+ metadata.gz: f14a2c0dcd6f3cca909c0b04d42dace1c21ba34b33d913bbb16ab3683c1567e212553c8b6eaff1300fb8ed5d060fa78467009928b72cebcc79ffc94711ece3fe
7
+ data.tar.gz: afefd79a3bbf2efbd4cbdd1ed1368b205c22141e19083773964f9a9fdfd0c885afb48acba531d4e46ec78f940fdbded374d11199177e47b688a292876949a1cf
@@ -48,6 +48,9 @@ module Structish
48
48
  key = attribute[:key]
49
49
  if attribute[:cast] && constructor[key]
50
50
  if attribute[:klass] == ::Array && attribute[:of]
51
+ unless constructor[key].class <= ::Array
52
+ raise(Structish::ValidationError.new("Class mismatch for #{attribute[:key]} -> #{constructor[key].class}. Should be a Array", self.class))
53
+ end
51
54
  constructor[key] = constructor[key].map { |v| cast_single(v, attribute[:of]) }
52
55
  else
53
56
  constructor[key] = cast_single(constructor[key], attribute[:klass])
@@ -1,3 +1,3 @@
1
1
  module Structish
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: structish
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dylan Blakemore
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-02 00:00:00.000000000 Z
11
+ date: 2021-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport