Skip to content

Commit

Permalink
rewrite end while to use kernel#loop
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewshafer committed Mar 11, 2014
1 parent de8ddb5 commit 056a247
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/tankard/api/utils/page_finders.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ def find_on_single_or_all_pages(uri, request, options, block)
def find_on_all_pages(uri, request, options, block)
page = 0

begin
loop do
page += 1
options[:p] = page if page > 1
total_pages = find_on_single_page(uri, request, options, block)
end while page < total_pages
break unless page < total_pages
end
end

def find_on_single_page(uri, request, options, block)
Expand Down

0 comments on commit 056a247

Please sign in to comment.