This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
every /
| name | age | message | |
|---|---|---|---|
| |
LICENSE | Sun Mar 15 22:34:46 -0700 2009 | |
| |
README | ||
| |
Rakefile | ||
| |
TODO | Mon Mar 16 07:06:29 -0700 2009 | |
| |
benchmarks.rb | ||
| |
every.gemspec | ||
| |
examples/ | ||
| |
lib/ | ||
| |
test/ |
README
Symbol#to_proc's hot cousin. Simple and elegant alternative to using &:method with enumerables.
compare:
enum = [1.4, 2.4 ,3.4]
enum.map {|i| i.floor } #=> [1, 2, 3]
enum.map(&:floor) #=> [1, 2, 3]
enum.map.floor #=> [1, 2, 3]
arguments? sure:
%w( axb dxf ).map.gsub(/x/,'y') #=> ['ayb', 'dyf']
%w( axb dxf ).map.gsub(/x/) { 'y' } #=> ['ayb', 'dyf']
works with any Enumerable method that takes a single-argument block:
[0, 1, 2].partition.zero? #=> [[0], [1, 2]]
[8, 9, 10].sort_by.to_s #=> [10, 8, 9]








