Class: SentryApi::PageLinks

Inherits:
Object
  • Object
show all
Defined in:
lib/sentry-api/page_links.rb

Overview

Parses link header.

Constant Summary collapse

'Link'.freeze
','.freeze
/<([^>]+)>; rel=\"([^\"]+)\"; results=\"([^\"]+)\"/
METAS =
%w(previous next)

Instance Method Summary collapse

Constructor Details

#initialize(headers) ⇒ PageLinks

Returns a new instance of PageLinks.



13
14
15
16
17
18
19
# File 'lib/sentry-api/page_links.rb', line 13

def initialize(headers)
  link_header = headers[HEADER_LINK]

  if link_header && link_header =~ /(previous|next)/
    extract_links(link_header)
  end
end