Technical Spiders


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

Related Posts

New blog setup 24 Jul 2013
So I built a Netflix app last weekend... 07 Feb 2011
Something that stinks about Ruby’s core library 22 Apr 2010
Ruby Can't Scale (Don't Listen to John Metta)! 24 Mar 2010
On Procs and Rubies 01 Aug 2009
comments powered by Disqus