Method: The86::Client::Response#links

Defined in:
lib/the86-client/response.rb


20
21
22
23
24
25
26
27
28
# File 'lib/the86-client/response.rb', line 20

def links
  @_links ||= {}.tap do |links|
    Array(headers["Link"] || headers["link"]).map do |link|
      link.match %r{\A<([^>]+)>;\s*rel="([^"]+)"\z}
    end.compact.each do |match|
      links[match[2].downcase.to_sym] = match[1]
    end
  end
end