28 Mar '12, 8pm

Oldie but I enjoy this post on Ruby's inject method

I find the inject solution less readable than something like: a = [1,2,3,4,5,6].map{|x| x.to_s if 0 == x % 2}.compact or a = [1,2,3,4,5,6].find_all{|x| 0 == x % 2}.map{|x| x.to_s} One of the aesthetic issues I have with inject is the requirement that the value the block returns becomes the result value for the next iteration. This is great when working with operations like addition, but the return value of hash assignment or pushing a value on an Array is nil. So in order to get inject to work you need that very unsightly return value line. I understand why it's like that, but I think it makes a strong case for using inject when the goal is to turn a set of something into a single something and for using set methods like map and select when transforming a set into another set.

Full article: http://blog.jayfields.com/2008/03/ruby-inject.html

Tweets

Ruby On REST 5: Learn Hypermedia By Making Frui...

rubyflow.com 27 Mar '12, 11am

Ruby On REST 5: Learn Hypermedia By Making Fruit Salad Posted by apotonick on March 27, 2012 — 0 comments Discussing the c...

Finally tracked down the "An error occurred"-bu...

pivotallabs.com 28 Mar '12, 3pm

My pair and I were recently working on an app that asynchronously loaded the Facebook Javascript SDK but synchronously loa...

@joshbuddy in case you didn't see it. cc: @nesq...

engineyard.com 28 Mar '12, 8pm

Engine Yard, Inc. Log in Login to Engine Yard Cloud Login to Orchestra PHP Cloud Products Engine Yard Cloud Engine Yard Ma...

Ruby Best Practices - Rails Modularity for Lazy...

blog.rubybestpractices.com 28 Mar '12, 4am

Rails Modularity for Lazy Bastards 2009-04-16 04:31, written by Gregory Brown When we develop standalone systems or work o...

Unicode in Regex - Ruby Forum:

ruby-forum.com 28 Mar '12, 11am

> Regular expressions for all character work would be a *terribly* slow > way to get things done. If you want to get the n...

7 Ruby Articles to Read Over The Holiday Season:

rubyinside.com 26 Mar '12, 11am

7 Ruby Articles to Read Over The Holiday Season By Peter Cooper / December 27, 2008 So here we are right in the down perio...

Did not realize that so many people had used my...

rubylearning.com 25 Mar '12, 1am

By Satish Talim RubyLearning.com is a thorough collection of Ruby Study Notes for those who are new to the Ruby programmin...

Rails 3.0’s ActiveModel: How To Give Ruby Class...

rubyinside.com 29 Mar '12, 1pm

In extracting the model-building parts of ActiveRecord, ActiveModel makes it possible to add model-like behavior to any Ru...

10 websites built using ruby on rails

10 websites built using ruby on rails

railshosting.org 24 Mar '12, 10pm

The top 10 websites built with Ruby on Rails Posted by Collin on 05/19/2011 in Rails Tutorials . Ruby is a growing force i...

Gregory Brown's free articles on #Ruby

blog.rubybestpractices.com 27 Mar '12, 8am

Practicing Ruby's second volume now freely available 2012-03-26 14:00, written by Gregory Brown Keeping with my promise to...

Ruby Lugdunum 2012 - Ruby Conf in Lyon, France

rubyflow.com 27 Mar '12, 3pm

Ruby Lugdunum 2012 - Ruby Conf in Lyon, France Posted by pcreux on March 27, 2012 — 0 comments Ruby Lugdunum (a.k.a Rulu) ...

The Current State of Ruby concurrency

rubyflow.com 26 Mar '12, 12pm

The Current State of Ruby concurrency Posted by nmerouze on March 26, 2012 — 0 comments I'm currently in a project using W...

Introducing Bloggy: A simple way to add a Jekyll blog to any Rails application

Introducing Bloggy: A simple way to add a Jekyl...

engineyard.com 31 Mar '12, 9pm

We have been working hard on making RVM rock-solid, and to prevent regressions while simultaneously fixing and improving i...

ZOMG! We're in Ruby Weekly!

rubyweekly.com 22 Mar '12, 12pm

No big announcements this week, but due to travel, next week's Ruby Weekly might be a bit skinnier than usual, late, or no...

Fifteen of my best Ruby articles are now freely...

rubyflow.com 26 Mar '12, 11am

Fifteen of my best Ruby articles are now freely available Posted by seacreature on March 26, 2012 — 0 comments When I star...