gitlab-org--gitlab-foss/lib/bitbucket/collection.rb
2016-12-07 15:54:32 +02:00

21 lines
424 B
Ruby

module Bitbucket
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|
block_given? ? yield(item) : item
end
end
end
end