debian-mirror-gitlab/lib/bitbucket/collection.rb

22 lines
424 B
Ruby
Raw Normal View History

2017-08-17 22:00:37 +05:30
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