Class: Bitbucket::Paginator
- Inherits:
-
Object
- Object
- Bitbucket::Paginator
- Defined in:
- lib/bitbucket/paginator.rb
Constant Summary collapse
- PAGE_LENGTH =
The minimum length is 10 and the maximum is 100.
50
Instance Method Summary collapse
-
#initialize(connection, url, type) ⇒ Paginator
constructor
A new instance of Paginator.
- #items ⇒ Object
Constructor Details
#initialize(connection, url, type) ⇒ Paginator
Returns a new instance of Paginator.
7 8 9 10 11 12 |
# File 'lib/bitbucket/paginator.rb', line 7 def initialize(connection, url, type) @connection = connection @type = type @url = url @page = nil end |
Instance Method Details
#items ⇒ Object
14 15 16 17 18 19 |
# File 'lib/bitbucket/paginator.rb', line 14 def items raise StopIteration unless has_next_page? @page = fetch_next_page @page.items end |