footing 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/extensions/hash.rb +13 -0
- metadata +7 -7
data/lib/extensions/hash.rb
CHANGED
@@ -37,5 +37,18 @@ module Footing
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
+
# Adjusts the values of the Hash in place.
|
41
|
+
#
|
42
|
+
# @example
|
43
|
+
# dict = {:a => 1, :b => 2, :c => 3}
|
44
|
+
# dict.adjust_values! { |v| v.to_s }
|
45
|
+
# dict # => {:a => "1", :b => "2", :c => "3"}
|
46
|
+
#
|
47
|
+
# @yield [value] Yields the current value to the block.
|
48
|
+
# The result of the block is then assigned to the corresponding key.
|
49
|
+
def adjust_values!
|
50
|
+
each { |k, v| self[k] = yield(v) }
|
51
|
+
end
|
52
|
+
|
40
53
|
end
|
41
54
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: footing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-09-02 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
|
-
description: !
|
15
|
-
|
16
|
-
|
14
|
+
description: ! ' Footing is a utillity belt library that employs sane monkey patching.
|
15
|
+
|
16
|
+
'
|
17
17
|
email:
|
18
18
|
- natehop@gmail.com
|
19
19
|
executables: []
|
@@ -53,9 +53,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
53
53
|
version: '0'
|
54
54
|
requirements: []
|
55
55
|
rubyforge_project:
|
56
|
-
rubygems_version: 1.8.
|
56
|
+
rubygems_version: 1.8.24
|
57
57
|
signing_key:
|
58
58
|
specification_version: 3
|
59
|
-
summary:
|
59
|
+
summary: A utility belt library.
|
60
60
|
test_files: []
|
61
61
|
has_rdoc:
|