Skip to content
This repository

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.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 LICENSE
Octocat-spinner-32 Manifest
Octocat-spinner-32 README
Octocat-spinner-32 Rakefile
Octocat-spinner-32 TODO
Octocat-spinner-32 benchmarks.rb
Octocat-spinner-32 every.gemspec
Octocat-spinner-32 examples.rb
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.