lib/gitlab/paginated_response.rb in gitlab-4.19.0 vs lib/gitlab/paginated_response.rb in gitlab-4.20.0
- old
+ new
@@ -28,11 +28,12 @@
def respond_to_missing?(method_name, include_private = false)
super || @array.respond_to?(method_name, include_private)
end
def parse_headers!(headers)
- @links = PageLinks.new headers
+ @links = Headers::PageLinks.new headers
+ @total = Headers::Total.new headers
end
def each_page
current = self
yield current
@@ -54,9 +55,13 @@
def paginate_with_limit(limit, &block)
return lazy_paginate.take(limit).to_a unless block
lazy_paginate.take(limit).each(&block)
+ end
+
+ def total
+ @total.total
end
def last_page?
!(@links.nil? || @links.last.nil?)
end