Sha256: e63a982b88acaed9aa1bcfa62fb60a64d3b8f356d023996127404c31ce1f313f

Contents?: true

Size: 482 Bytes

Versions: 12

Compression:

Stored size: 482 Bytes

Contents

module Twitter
  module Enumerable
    include ::Enumerable

    # @return [Enumerator]
    def each(start = 0)
      return to_enum(:each, start) unless block_given?
      Array(@collection[start..-1]).each do |element|
        yield(element)
      end
      unless last?
        start = [@collection.size, start].max
        fetch_next_page
        each(start, &Proc.new)
      end
      self
    end

  private

    # @return [Boolean]
    def last?
      true
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
twitter-6.2.0 lib/twitter/enumerable.rb
twitter-6.1.0 lib/twitter/enumerable.rb
twitter-6.0.0 lib/twitter/enumerable.rb
twitter-5.17.0 lib/twitter/enumerable.rb
twitter-5.16.0 lib/twitter/enumerable.rb
twitter-5.15.0 lib/twitter/enumerable.rb
twitter-5.14.0 lib/twitter/enumerable.rb
twitter-5.13.0 lib/twitter/enumerable.rb
twitter-5.12.0 lib/twitter/enumerable.rb
twitter-5.11.0 lib/twitter/enumerable.rb
twitter-5.10.0 lib/twitter/enumerable.rb
twitter-5.9.0 lib/twitter/enumerable.rb