squared 0.5.10 → 0.5.12

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.
@@ -11,6 +11,21 @@ module Squared
11
11
  def hashlist
12
12
  Hash.new { |data, key| data[key] = [] }
13
13
  end
14
+
15
+ def hashdup(data, pass: {})
16
+ ret = {}
17
+ data.each do |key, val|
18
+ ret[key] = case val
19
+ when Hash
20
+ pass[val] ||= hashdup(val, pass: pass)
21
+ when Proc, Method
22
+ val
23
+ else
24
+ val.dup
25
+ end
26
+ end
27
+ ret
28
+ end
14
29
  end
15
30
  end
16
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: squared
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.10
4
+ version: 0.5.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - An Pham