# File lib/t/collectable.rb, line 20 def collect_with_max_id(collection=[], max_id=nil, &block) array = retryable(:tries => 3, :on => Twitter::Error::ServerError, :sleep => 0) do yield max_id end return collection if array.nil? collection += array array.empty? ? collection.flatten : collect_with_max_id(collection, array.last.id - 1, &block) end