public
Description: Symbol#to_proc's hot cousin. Simple and elegant alternative to using &:method with enumerables.
Homepage: http://mynyml.com/15-enumerableevery/
Clone URL: git://github.com/mynyml/every.git
every /
name age message
file LICENSE Sun Mar 15 22:34:46 -0700 2009 Add license. [mynyml]
file Manifest Wed Nov 04 06:19:15 -0800 2009 Don't hardcode require paths Also simplified t... [mynyml]
file README Wed Apr 01 21:49:37 -0700 2009 Don't mention block alternative in README. [mynyml]
file Rakefile Wed Nov 04 06:38:57 -0800 2009 Port to minitest [mynyml]
file TODO Mon Mar 16 07:06:29 -0700 2009 Add TODO list. [mynyml]
file benchmarks.rb Wed Apr 08 17:00:59 -0700 2009 Clean up benchmarks. [mynyml]
file every.gemspec Wed Nov 04 08:06:24 -0800 2009 v1.1 [mynyml]
file examples.rb Tue May 19 13:20:16 -0700 2009 Updated examples file. [mynyml]
directory lib/ Wed Nov 04 06:47:25 -0800 2009 Now ruby1.9 compatible [mynyml]
directory test/ Wed Nov 04 06:51:00 -0800 2009 Now jruby compatible [mynyml]
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.every.floor        #=> [1, 2, 3]

arguments? sure:

  %w( axb dxf ).every.gsub(/x/,'y')     #=> ['ayb', 'dyf']
  %w( axb dxf ).every.gsub(/x/) { 'y' } #=> ['ayb', 'dyf']