Ruby enumerable every
10 Apr 2009
Enumerable Every
Pretty cool idea, it replaces the notion of Symbol#to_proc with a slightly cleaner, simpler syntax.
enum = [1.4, 2.4 ,3.4]
enum.map {|n| n.floor } # => [1, 2, 3]
enum.map(&:floor) # => [1, 2, 3]
enum.every.floor # => [1, 2, 3]
neat! Who says you can’t make things simpler.
Check it out on github. ruby