glue 0.17.0 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,28 +0,0 @@
1
- #!/usr/local/bin/ruby -w
2
- #
3
- # == extensions/symbol.rb
4
- #
5
- # Adds methods to the builtin Symbol class.
6
- #
7
-
8
- require "extensions/_base"
9
-
10
-
11
- #
12
- # * Symbol#to_proc
13
- #
14
- ExtensionsProject.implement(Symbol, :to_proc) do
15
- class Symbol
16
- #
17
- # Allows a Symbol to be implicitly converted to a Proc.
18
- #
19
- # This allows such conveniences as:
20
- # %{john terry fiona}.map(&:capitalize) # -> %{John Terry Fiona}
21
- # sum = numbers.inject(&:+)
22
- #
23
- def to_proc
24
- proc { |obj, *args| obj.send(self, *args) }
25
- end
26
- end
27
- end
28
-