ROM::Gateway.setup

Parsed documentation:
View on GitHub
Set up a gateway

@overload setup(type, *args)
  Sets up a single-gateway given a gateway type.
  For custom gateways, create an instance and pass it directly.

  @example
    module SuperDB
      class Gateway < ROM::Gateway
        def initialize(options)
        end
      end
    end

    ROM.register_adapter(:super_db, SuperDB)

    Gateway.setup(:super_db, some: 'options')
    # SuperDB::Gateway.new(some: 'options') is called

  @param [Symbol] type Registered gateway identifier
  @param [Array] args Additional gateway options

@overload setup(gateway)
  Set up a gateway instance

  @example
    module SuperDB
      class Gateway < ROM::Gateway
        def initialize(options)
        end
      end
    end

    ROM.register_adapter(:super_db, SuperDB)

    Gateway.setup(SuperDB::Gateway.new(some: 'options'))

  @param [Gateway] gateway

@return [Gateway] a specific gateway subclass

@api public
Suggestions:
Please help! Open an issue on GitHub if this assessment is incorrect.