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: gateway.rb
    path of file: ./repos/rom/lib/rom/components
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

require "rom/open_struct"
require_relative "core"

module ROM
  module Components
    # @api public
    class Gateway < Core
      # @api public
      def build
        gateway = adapter.is_a?(ROM::Gateway) 
    
      def build
        gateway = adapter.is_a?(ROM::Gateway) ? adapter : setup

        # TODO: once Gateway is unified with the rest of component types, this
        #       won't be needed as it'll happen automatically when inheriting
        #       config settings
        gateway_config.plugins.concat(gateway.class.config.component.plugins)

        gateway.instance_variable_set("@config", gateway_config)
        gateway.use_logger(config.logger) if config.logger

        gateway
      end