mpatch 2.8.0 → 2.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/mpatch/hash.rb +13 -0
- 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: 5d3b57e9a4cc8dab797ca68d8414ffddef06c6a7
|
4
|
+
data.tar.gz: eb443c2ee71867129b43a0e1c053fa384cb7b631
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ec36f94ce8777af0c9c8f470741044004ef36873364c016040553be28b351b0a7d3eb3431cdab565a7a5a604a034ebeaca109874865d343450c828fc1e6bdf3
|
7
|
+
data.tar.gz: fa99e29c236c18bb4035f490ef681aaef02b6075d9e92651b07236a8686170655527966c2e857175afebec86acdc9339c8c954500e50e3820b8307f154a2df4b
|
data/VERSION
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
2.8.
|
1
|
+
2.8.1
|
2
2
|
|
data/lib/mpatch/hash.rb
CHANGED
@@ -110,6 +110,19 @@ module MPatch
|
|
110
110
|
return tmp_hash
|
111
111
|
end
|
112
112
|
|
113
|
+
# Fetch a nested hash value
|
114
|
+
def value_by_keys(*attrs)
|
115
|
+
attr_count = attrs.size
|
116
|
+
current_val = self
|
117
|
+
for i in 0..(attr_count-1)
|
118
|
+
attr_name = attrs[i]
|
119
|
+
return current_val[attr_name] if i == (attr_count-1)
|
120
|
+
return nil if current_val[attr_name].nil?
|
121
|
+
current_val = current_val[attr_name]
|
122
|
+
end
|
123
|
+
return nil
|
124
|
+
end
|
125
|
+
|
113
126
|
end
|
114
127
|
|
115
128
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mpatch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.8.
|
4
|
+
version: 2.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Luzsi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: This is a collection of my Ruby monkey patches for making easer to use
|
14
14
|
the basic classes
|