casted_hash 0.8.2 → 0.8.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 +4 -4
- data/lib/casted_hash.rb +3 -4
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 03378381efaa2103f51e8d24a28e45c9552a250e
|
|
4
|
+
data.tar.gz: 6fb6af08d855b0f90aed7d1a2bbe1f1aacf94c59
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7b532049f57b95324a74b5143b6250a68addd9956667b927df833ae1848650651a43e3ef72985c47064fbc9b177082792e04f9774bba85b188fc046d837a257b
|
|
7
|
+
data.tar.gz: 3eb0283ce3eff6fc1c09077507d5da13c40f33ea0fd416f82aa2804842120ae85b624a477fb142045329ead194df85d252725181df3fea47e8caf714232b134d
|
data/lib/casted_hash.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
class CastedHash < Hash
|
|
2
|
-
VERSION = "0.8.
|
|
2
|
+
VERSION = "0.8.3"
|
|
3
3
|
|
|
4
4
|
def initialize(constructor = {}, cast_proc = nil)
|
|
5
5
|
raise ArgumentError, "`cast_proc` required" unless cast_proc
|
|
@@ -8,9 +8,9 @@ class CastedHash < Hash
|
|
|
8
8
|
@casting_keys = []
|
|
9
9
|
|
|
10
10
|
if constructor.is_a?(CastedHash)
|
|
11
|
-
super()
|
|
12
11
|
@casted_keys = constructor.instance_variable_get(:@casted_keys).dup
|
|
13
|
-
|
|
12
|
+
super()
|
|
13
|
+
update(constructor)
|
|
14
14
|
elsif constructor.is_a?(Hash)
|
|
15
15
|
@casted_keys = []
|
|
16
16
|
super()
|
|
@@ -48,7 +48,6 @@ class CastedHash < Hash
|
|
|
48
48
|
end
|
|
49
49
|
|
|
50
50
|
alias_method :regular_writer, :[]= unless method_defined?(:regular_writer)
|
|
51
|
-
alias_method :regular_update, :update unless method_defined?(:regular_update)
|
|
52
51
|
|
|
53
52
|
def []=(key, value)
|
|
54
53
|
key = convert_key(key)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: casted_hash
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.8.
|
|
4
|
+
version: 0.8.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stephan Kaag
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-05-
|
|
11
|
+
date: 2016-05-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|