Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Symbol#to_proc's hot cousin. Simple and elegant alternative to using &:method with enumerables.
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib Now ruby1.9 compatible
test Now jruby compatible
LICENSE Add license.
Manifest Don't hardcode require paths
README
Rakefile Port to minitest
TODO Add TODO list.
benchmarks.rb Clean up benchmarks.
every.gemspec v1.1
examples.rb Updated examples file.

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']
Something went wrong with that request. Please try again.