Created
December 12, 2011 12:17
-
-
Save built/1466897 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def group?(current, last) | |
current.created_at - last.created_at < 1.minute | |
end | |
recent_statuses.inject([]) { |results, status| | |
next results << [status] if results.empty? # Can't compare first item. | |
results << group?(status, results.last.last) ? stat : [stat] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oh, and I think I have a bug. Damn, this is why you don't write code at 4 in the morning. Well, I shouldn't anyway.