Class: Niftycloud::PageLinks

Inherits:
Object
  • Object
show all
Defined in:
lib/niftycloud/page_links.rb

Constant Summary collapse

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

Instance Method Summary collapse

Constructor Details

#initialize(headers) ⇒ PageLinks

Returns a new instance of PageLinks.



10
11
12
13
14
15
16
# File 'lib/niftycloud/page_links.rb', line 10

def initialize(headers)
  link_header = headers[HEADER_LINK]

  if link_header && link_header =~ /(next|first|last|prev)/
    extract_links(link_header)
  end
end