Why would Google buy the Twitter open source project?

Why would Google spend over $250 million for Twitter, an open source project written in Rails?