You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: signature_parser.rb
    path of file: ./repos/mastodon/app/lib
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

class SignatureParser
  class ParsingError < StandardError; end

  # The syntax of this header is defined in:
  # https://datatracker.ietf.org/doc/html/draft-cavage-http-signatures-12#section-4
  # See https://datatracker.ietf.org/doc/html/rfc7235#appendix-C
  # and https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.
    
  def self.parse(raw_signature)
    # Old versions of node-http-signature add an incorrect "Signature " prefix to the header
    raw_signature = raw_signature.delete_prefix('Signature ')

    params = {}
    scanner = StringScanner.new(raw_signature)

    # Use `skip` instead of `scan` as we only care about the subgroups
    while scanner.skip(PARAM_RE)
      # This is not actually correct with regards to quoted pairs, but it's consistent
      # with our previous implementation, and good enough in practice.
      params[scanner[:key]] = scanner[:value] || scanner[:quoted_value][1...-1]

      scanner.skip(/\s*/)
      return params if scanner.eos?

      raise ParsingError unless scanner.skip(/\s*,\s*/)
    end