Skip to content

Instantly share code, notes, and snippets.

@built
Created December 12, 2011 12:17
Show Gist options
  • Save built/1466897 to your computer and use it in GitHub Desktop.
Save built/1466897 to your computer and use it in GitHub Desktop.
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]
}
@built
Copy link
Author

built commented Dec 12, 2011

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment