Feeds:
Posts
Comments

Archive for November, 2008

Lockdown 0.6.0 released!

Here’s the link to the news release on stonean.com.
btw, if you’d like to get this type of information from twitter, you can.

Read Full Post »

Ruby: inject

Inject is a powerfully cool method provided by the Enumerable module. At first I was a little confused by the name. I didn’t know what it meant. Here’s a simple example:
an_array = [1, 2, 3, 4, 5, 6]

def x10(v)
v * 10
end

an_array.inject([]) do |sum, num|
sum << x10(num)
end

=> [10, 20, [...]

Read Full Post »