casted_hash 0.8.3 → 0.8.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/casted_hash.rb +6 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 03378381efaa2103f51e8d24a28e45c9552a250e
4
- data.tar.gz: 6fb6af08d855b0f90aed7d1a2bbe1f1aacf94c59
3
+ metadata.gz: 5e0fdde9d0be05ae67fc01e13efb414a6391f440
4
+ data.tar.gz: 05fd32baa77c4e96a67a6b09b2b0bf5eb3d20e64
5
5
  SHA512:
6
- metadata.gz: 7b532049f57b95324a74b5143b6250a68addd9956667b927df833ae1848650651a43e3ef72985c47064fbc9b177082792e04f9774bba85b188fc046d837a257b
7
- data.tar.gz: 3eb0283ce3eff6fc1c09077507d5da13c40f33ea0fd416f82aa2804842120ae85b624a477fb142045329ead194df85d252725181df3fea47e8caf714232b134d
6
+ metadata.gz: f5a65a41fdb982bc127128715d6e4a3fa8ce2de31069d230a5fc5f61bf7165da5c9da46691c2d7f4697c49014e98c2944fd4432cca7010ab6f23110179008570
7
+ data.tar.gz: 7ca40f81878b5399d013e9f4f0d75d3424a56eb499c745eeacc9888bfc8e13b9a325d33287ec100394061c4ed565b5ab52fa56a0e68c83e754f22158fcad8460
data/lib/casted_hash.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  class CastedHash < Hash
2
- VERSION = "0.8.3"
2
+ VERSION = "0.8.4"
3
3
 
4
4
  def initialize(constructor = {}, cast_proc = nil)
5
5
  raise ArgumentError, "`cast_proc` required" unless cast_proc
@@ -94,7 +94,11 @@ class CastedHash < Hash
94
94
  end
95
95
 
96
96
  def dup
97
- self.class.new(self, @cast_proc)
97
+ duplicate = super
98
+ instance_variables.each do |instance_variable|
99
+ duplicate.instance_variable_set(instance_variable, instance_variable_get(instance_variable).dup)
100
+ end
101
+ duplicate
98
102
  end
99
103
 
100
104
  def delete(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.3
4
+ version: 0.8.4
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-10 00:00:00.000000000 Z
11
+ date: 2016-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler