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

24 lines
509 B
Ruby
Raw Normal View History

2018-07-25 08:22:53 -04:00
# frozen_string_literal: true
2018-07-11 02:21:12 -04:00
module BitbucketServer
class Collection < Enumerator
def initialize(paginator)
super() do |yielder|
loop do
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