1
2
3
4
module Enumerable
    def cluster 
        sort.inject([[]]) do |out, n|
...

Ruby Enumerable#cluster

by Erik, July 18, 2008 02:44, 10 refactorings, tagged with cluster, inject, array

%w[app noot app mies zoo m...

Avatar Talk
1
2
3
require 'uri'
uri=URI.parse("http://www.mydomain.com/search?q=foo&bar=stick&who=you")
uri_params=uri.query.inject({}) {|hsh,i| sides=i.split("="); hsh[sides[0]]=sides[1]; hsh}

Ruby Query String to Hash

by seal-7.blogspot.com, July 10, 2008 13:18, 6 refactorings, tagged with inject, querystring

Probably can't be refactore...

Avatar Talk