Class: Gitlab::Headers::PageLinks
- Inherits:
-
Object
- Object
- Gitlab::Headers::PageLinks
- Defined in:
- lib/gitlab/headers/page_links.rb
Overview
Parses link header.
Constant Summary collapse
- HEADER_LINK =
'Link'
- DELIM_LINKS =
','
- LINK_REGEX =
/<([^>]+)>; rel="([^"]+)"/
- METAS =
%w[last next first prev].freeze
Instance Method Summary collapse
-
#initialize(headers) ⇒ PageLinks
constructor
A new instance of PageLinks.
Constructor Details
#initialize(headers) ⇒ PageLinks
Returns a new instance of PageLinks.
16 17 18 19 20 |
# File 'lib/gitlab/headers/page_links.rb', line 16 def initialize(headers) link_header = headers[HEADER_LINK] extract_links(link_header) if link_header && link_header =~ /(next|first|last|prev)/ end |