Skip to content

Instantly share code, notes, and snippets.

@borischerkasky
Last active November 8, 2019 12:19
Show Gist options
  • Save borischerkasky/ecd6eb26c3d395fc3c06d979617ec0c7 to your computer and use it in GitHub Desktop.
Save borischerkasky/ecd6eb26c3d395fc3c06d979617ec0c7 to your computer and use it in GitHub Desktop.
def get_next_page(res)
res.headers['link']&.
split(',')&.
select{|x| x.include? 'next'}&.first&.split(';')&.
first&.
gsub(/[ ><]/,'')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment