Module: Sentry::PaginationParser

Defined in:
lib/sentry/pagination_parser.rb

Constant Summary collapse

PATTERN =
/rel=\"(?<direction>\w+)\";\sresults=\"(?<results>\w+)\";\scursor=\"(?<cursor>.+)\"/.freeze

Class Method Summary collapse

Class Method Details

.parse(headers) ⇒ Object


7
8
9
10
11
# File 'lib/sentry/pagination_parser.rb', line 7

def self.parse(headers)
  links = headers['link'].to_s.split(',')

  links.map { |link| parse_link(link) }.compact.to_h
end