diff options
Diffstat (limited to 'lib/sentry/pagination_parser.rb')
-rw-r--r-- | lib/sentry/pagination_parser.rb | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/lib/sentry/pagination_parser.rb b/lib/sentry/pagination_parser.rb deleted file mode 100644 index fa9c1dd8694..00000000000 --- a/lib/sentry/pagination_parser.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -module Sentry - module PaginationParser - PATTERN = /rel=\"(?<direction>\w+)\";\sresults=\"(?<results>\w+)\";\scursor=\"(?<cursor>.+)\"/.freeze - - def self.parse(headers) - links = headers['link'].to_s.split(',') - - links.map { |link| parse_link(link) }.compact.to_h - end - - def self.parse_link(link) - match = link.match(PATTERN) - - return unless match - return if match['results'] != "true" - - [match['direction'], { 'cursor' => match['cursor'] }] - end - private_class_method :parse_link - end -end |