hash_schema 0.1.1 → 0.1.2

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
  SHA1:
3
- metadata.gz: 7788877ffd7c7aa507ade3fbb84cfbe58a2ad6e8
4
- data.tar.gz: 2a2b2aa4fab62601f1cf5af5dd13676a383a1089
3
+ metadata.gz: d3b7349c659a2350aa25c7458299b28585588c51
4
+ data.tar.gz: 8fd0f8a09a4efc41f210c8a249248a1ea3d209d1
5
5
  SHA512:
6
- metadata.gz: 1dd7c75d6b8f258d3d89d43cca6f1f1641ec3756b797d1b5c3ca01c3d44750ace31a329d2f616a1689b97f8baa85c3af1ca50b52ff7df090310cd2031ed5b19b
7
- data.tar.gz: 202e68b5160accf317d017abc5185c1aa05dab9bd6c94281099f36693b98386081ed39ad7a7731d5c4f0926ccbae105116f761a748be5376a7d49e296a1c82ff
6
+ metadata.gz: cf3e54beb99430de451ac85d7c1094fceec8e10c1096c55eefa740a75fbbdd816d1d627ef9cd722797786d307bf53892fb669f8b5e5e970f4c186e65c61812c9
7
+ data.tar.gz: cda472ff701fc474a1846e31c0ed90f14a9b3486fbfa34415d4fbb7b14a8ba769da48f84adde52361494ead9fb1a52fee36253e160a3359250b700969065d413
data/lib/hash_schema.rb CHANGED
@@ -159,7 +159,7 @@ module HashSchema
159
159
  return error(hash) unless hash.is_a?(Hash)
160
160
  {}.tap do |output|
161
161
  chain.each do |key, schema|
162
- val = hash[key] || hash.fetch(key.to_s, Void.new)
162
+ val = hash.fetch(key, hash.fetch(key.to_s, Void.new))
163
163
  output[key] = if schema.kind_of?(Schema)
164
164
  schema.validate(val)
165
165
  else
@@ -1,3 +1,3 @@
1
1
  module HashSchema
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hash_schema
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Po Chen