This post originated from an RSS feed registered with Ruby Buzz
by Red Handed.
Original Post: Thin Strand of Search-and-Replace Rails
Feed Title: RedHanded
Feed URL: http://redhanded.hobix.com/index.xml
Feed Description: sneaking Ruby through the system
If you’re playing with Rails and you want to better understand Ruby blocks, as well as method chaining, Matthew Bohnsack has a great one-liner, which boils to:
More like three or four lines, but still. He breaks it up, explains each part, with short paragraph-long lessons. I like how code like the above has the feeling of a sed recipe, but isn’t utterly cryptic.