backports 3.0.1 → 3.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/backports/2.0.0/hash.rb +2 -3
- data/lib/backports/version.rb +1 -1
- metadata +1 -1
data/lib/backports/2.0.0/hash.rb
CHANGED
@@ -3,9 +3,7 @@ class Hash
|
|
3
3
|
self
|
4
4
|
end unless method_defined? :to_h
|
5
5
|
|
6
|
-
|
7
|
-
{}.default_proc = nil
|
8
|
-
rescue
|
6
|
+
if (({}.default_proc = nil) rescue true)
|
9
7
|
def default_proc_with_nil=(proc)
|
10
8
|
if proc == nil
|
11
9
|
self.default = nil
|
@@ -14,6 +12,7 @@ class Hash
|
|
14
12
|
self.default_proc_without_nil=(proc)
|
15
13
|
end
|
16
14
|
end
|
15
|
+
Backports.alias_method_chain(self, :default_proc=, :nil)
|
17
16
|
end
|
18
17
|
end
|
19
18
|
|
data/lib/backports/version.rb
CHANGED