clean-hash 0.5.8 → 0.5.9
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 504ba0826c7c49fb67852d5727cee9c8eababa06ca8bfe16d549a1d2324635da
|
4
|
+
data.tar.gz: 73d2a4313ea7894e3c5e6a213c7795a9d55c0c1c4b212b47eb40589ddec92f1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8be703db8baadcf96226318759def32120eef6ba618e3eda2f995c96ba01e237fb3bb7939305b68113992d0ffac0b1b426d49e7c1188208ac0eac1ede74b96d7
|
7
|
+
data.tar.gz: 790cf981f6050241151116bd468ea69c947b9fa7d3ca497e7fe3b5d29e9f6a978069564c4d94d0c9bd0e129fba6593e1bf979762f61bed2b8447a524533cb29b
|
data/.version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.9
|
@@ -25,11 +25,12 @@ class CleanHash
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def delete key
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
28
|
+
out = []
|
29
|
+
out.push @data.delete(key)
|
30
|
+
out.push @data.delete(key.to_s)
|
31
|
+
out.push @data.delete(key.to_sym) if key.respond_to?(:to_sym)
|
32
|
+
out.each { |el| return el unless el.nil? }
|
33
|
+
nil
|
33
34
|
end
|
34
35
|
|
35
36
|
def to_h
|
@@ -3,11 +3,11 @@ class CleanHash
|
|
3
3
|
def []= key, value
|
4
4
|
value = value.to_s if value.is_a?(Symbol)
|
5
5
|
|
6
|
-
|
7
|
-
|
6
|
+
for kind in [NilClass, Hash, Numeric, String, TrueClass, FalseClass]
|
7
|
+
return super if value.is_a?(kind)
|
8
8
|
end
|
9
9
|
|
10
|
-
|
10
|
+
raise ArgumentError.new('Unsupported safe type: %s' % value.class)
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clean-hash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dino Reic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashie
|
@@ -37,7 +37,6 @@ files:
|
|
37
37
|
- "./lib/clean-hash/hash_pollute.rb"
|
38
38
|
- "./lib/clean-hash/pollute.rb"
|
39
39
|
- "./lib/clean-hash/types/indifferent_type.rb"
|
40
|
-
- "./lib/clean-hash/types/micro_indifferent.rb"
|
41
40
|
- "./lib/clean-hash/types/mutex_type.rb"
|
42
41
|
- "./lib/clean-hash/types/safe_type.rb"
|
43
42
|
- "./lib/clean-hash/types/strict_type.rb"
|