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: parser.rb
    path of file: ./repos/aws-sdk-ruby/gems/aws-sdk-core/lib/aws-sdk-core/rest/response
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Aws
  module Rest
    module Response
      class Parser

        def apply(response)
     
    
        def parser_class(response)
          protocol = response.context.config.api.metadata['protocol']
          case protocol
          when 'rest-xml' then Xml::Parser
          when 'rest-json' then Json::Parser
          when 'api-gateway' then Json::Parser
          else raise "unsupported protocol #{protocol}"
          end