gitlab-org--gitlab-foss/lib/bitbucket/collection.rb

22 lines
472 B
Ruby
Raw Normal View History

module Bitbucket
class Collection < Enumerator
def initialize(paginator)
super() do |yielder|
loop do
2016-12-07 08:54:32 -05:00
paginator.items.each { |item| yielder << item }
end
end
lazy
end
def method_missing(method, *args)
return super unless self.respond_to?(method)
self.__send__(method, *args) do |item| # rubocop:disable GitlabSecurity/PublicSend
block_given? ? yield(item) : item
end
end
end
end