summaryrefslogtreecommitdiff
path: root/lib/bitbucket/collection.rb
blob: a6a31de3ce61da2bdfd806d5f493d634d9599a3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

module Bitbucket
  class Collection < Enumerator
    def initialize(paginator)
      super() do |yielder|
        loop do
          paginator.items.each { |item| yielder << item }
        end
      end

      lazy
    end
  end
end