data_model 0.6.0 → 0.6.1

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: f3a30187193b436d7dd863a4b2fe28d8baf21428d6fd936cb67555e9792786a7
4
- data.tar.gz: e44e496aaf29d7ecd8dfd5633aae5275bb67a1ecfb821f7a64137f9532c36cca
3
+ metadata.gz: ec442d524136b58a53447650cd644a801b6fd117c8329462745d8f3891409c72
4
+ data.tar.gz: 9de27ed2d8b6f079dcbd9def6fc7afe4b051a1ce307d9156bee0ddfdd473f811
5
5
  SHA512:
6
- metadata.gz: 9fd5b20f3a87909ef221656b6b541413f1201759e08cc51af148fbd18037c0b54b0253e2e21f51adf4503d4b61d1dbe4e5a929a62310574964e9214875d772a8
7
- data.tar.gz: 47c5090b016f7ac15162c74e62464da01b1a4c170ae52db0f28f63d71a7686f7acd3063624b8c2ec5813d76fa826af56a1b4649d85162d220877e8053ff63890
6
+ metadata.gz: c87894d04c913e2c3e1e7af718553da465cdd5ea519c5c3b88d9fc3dcfd701852100a85b992a168041d772dcd726a0c691b47c8de5d916d329202a34e34f19cb
7
+ data.tar.gz: 65422078b7c9a5a9f0a11164e0722387d032a65a985bd7056d1d45157719797171a2b05482faa62b840006fe9fa1b42041b70495fec0c7840299407a5dd9153e
@@ -96,14 +96,21 @@ module DataModel
96
96
  send("#{k}=", v)
97
97
  end
98
98
 
99
- for req in self.class.required_types
99
+ required_types = self.class.required_types
100
+ found = []
101
+
102
+ for req in required_types
100
103
  for key in data.keys
101
104
  if key.to_s == req.to_s
102
- next
105
+ found << req
106
+ break
103
107
  end
104
108
  end
105
-
106
- raise "Missing required field #{req}"
109
+ end
110
+
111
+ found = required_types - found
112
+ if !found.empty?
113
+ raise "Missing required fields: #{found.join(', ')}"
107
114
  end
108
115
  end
109
116
 
@@ -1,3 +1,3 @@
1
1
  module DataModel
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data_model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Briggs