anchor.diff:  
   ```ruby
   Array(@collection[start..-1]).each do |element|
  -  yield(element)
  +yield(element)
   end
   ```
   
  
positive.code: pull_image: 'https://rossta.net/assets/images/icons/noun_63453.png'
  series: Enumerable
  tags:
    - Code
    - Ruby
  ---
  
  The thing with paginated data is we can't get it all at once.
  
  Let's say you want to use the [Trello API](https://developers.trello.com/). You want know how many Trello cards you marked as completed each month since last January, but you don't __want to think about *pages*__. <img src="<%= image_path('icons/noun_63447.png') %>" class="icon-image inline" /> <img src="<%= image_path('icons/noun_63453.png') %>" class="icon-image inline" />
  
  There are a number of Trello endpoints that return paginated data sets, such as boards, lists,
  cards, and actions (like comments, copies, moves, etc). In most cases, Trello will provide a
  default limit, typically 50, on the number of resources returned in a single request. But what if you need more than that?
  
  In this post, we'll examine a few ways to collect paginated results in Ruby.
  
  ### Trello World
  
  
negative.code: MAX = 1000
  
  def paginated_get(path, options = {})
  params  = options.dup
  page    = params.delete(:page) { 1 }
  limit   = params.fetch(:limit) { 50 }
  results = []
  
  loop do
  data = get(path, { page: page }.merge(params))
  
  page += 1
  results += data
  
  break if (data.empty? || page * limit >= MAX)
  end
  
  results
  end
  ```
  
  