module Bullion::Helpers::Service

def link_headers_to_hash(values_string)

def link_headers_to_hash(values_string)
  return {} unless values_string&.length&.positive?
  values_string.split(",").to_h do |relation|
    raw_value, raw_name = relation.split(";")
    value = /^<(.+)>$/.match(raw_value)[1]
    name = /^rel="(.+)"$/.match(raw_name)[1]
    [name, value]
  end
end