mug 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mug/hashop.rb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8bd20df28d6c397c1b8ca6c6f192535e0e284b7
|
4
|
+
data.tar.gz: 95dc5a3fabcffe510bd9d11a401278778b6aa657
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3c6fa2f5857995d03b81c775324f5ece3a3f9c1fc6b111420c570920906c12c4956af577d19424fca87522092f7bbcb7cc61037b90dab4e0db3630b59e8612e
|
7
|
+
data.tar.gz: 771e8542c3368b7b331e1aa052a06993cb9ade5a0b04fd86953f756b1446b99d188f6f4e16ee506b027d5f1a6260f7b9bc1f10e70fa21f1482ec7fd1c4988292
|
data/lib/mug/hashop.rb
CHANGED
@@ -3,7 +3,7 @@ class Hash
|
|
3
3
|
|
4
4
|
#
|
5
5
|
# Returns a new Hash, whose value is the same as this
|
6
|
-
# one, with any extras in +
|
6
|
+
# one, with any extras in +other_hash+ added in.
|
7
7
|
#
|
8
8
|
# Useful for default options.
|
9
9
|
#
|
@@ -12,8 +12,8 @@ class Hash
|
|
12
12
|
# dflt = {:a => 0, :x => 9 }
|
13
13
|
# opts |= dflt # => opts = {:a=>1, :b=>2, :x=>9}
|
14
14
|
#
|
15
|
-
def |
|
16
|
-
|
15
|
+
def | other_hash
|
16
|
+
other_hash.merge self
|
17
17
|
end
|
18
18
|
|
19
19
|
#
|
@@ -43,7 +43,7 @@ class Hash
|
|
43
43
|
if o.respond_to? :to_hash
|
44
44
|
merge! o.to_hash
|
45
45
|
elsif o.respond_to?(:to_a) && (a = o.to_a) && a.length == 2
|
46
|
-
store a[0], a[1]
|
46
|
+
tap { store a[0], a[1] }
|
47
47
|
elsif o.respond_to? :to_h
|
48
48
|
merge! o.to_h
|
49
49
|
else
|