hashlib 0.0.22 → 0.0.23
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/hashlib.rb +9 -4
- metadata +1 -1
data/lib/hashlib.rb
CHANGED
@@ -13,6 +13,14 @@ class Hash
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def get(path, default=nil)
|
16
|
+
rget(path, default)
|
17
|
+
end
|
18
|
+
|
19
|
+
def set(path, value)
|
20
|
+
rset(path, value)
|
21
|
+
end
|
22
|
+
|
23
|
+
def rget(path, default=nil)
|
16
24
|
rv = self
|
17
25
|
|
18
26
|
# make path an array if not already
|
@@ -74,7 +82,7 @@ class Hash
|
|
74
82
|
return rv
|
75
83
|
end
|
76
84
|
|
77
|
-
def
|
85
|
+
def rset(path, value)
|
78
86
|
if not path.is_a?(Array)
|
79
87
|
path = path.to_s.strip.split(/[\/\.]/)
|
80
88
|
end
|
@@ -220,9 +228,6 @@ class Hash
|
|
220
228
|
end
|
221
229
|
return rv
|
222
230
|
end
|
223
|
-
|
224
|
-
alias_method :set, :rset
|
225
|
-
alias_method :get, :rget
|
226
231
|
end
|
227
232
|
|
228
233
|
class Array
|