Skip to content

Instantly share code, notes, and snippets.

@adback03
Last active January 21, 2016 07:30
Show Gist options
  • Save adback03/42e3cd6ec4493f51424f to your computer and use it in GitHub Desktop.
Save adback03/42e3cd6ec4493f51424f to your computer and use it in GitHub Desktop.
require 'mtg_sdk'
def get_all_cards
page = 1
cards = []
cards << MTG::Card.where(page: page).get
while true
results = MTG::Card.where(page: page += 1).get
results.empty? ? break : cards.concat(results)
end
cards
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment