ROM::Gateway.setup

Parsed documentation:
View on GitHub
Setup 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.

  @param [Symbol] type
  @param [Array] *args

@overload setup(gateway)
  @param [Gateway] gateway

@return [Gateway] a specific gateway subclass

@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

  # or alternatively
  super_db = Gateway.setup(SuperDB::Gateway.new(some: 'options'))
  Gateway.setup(super_db)

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