Sha256: 26019d4523c7652fe32680e7e7d44d70162b1eaec82cb0ca22b093588f56bc2f

Contents?: true

Size: 707 Bytes

Versions: 1

Compression:

Stored size: 707 Bytes

Contents

# frozen_string_literal: true

require 'api_proxy/version'

require 'active_support/all'

module ApiProxy
  extend ActiveSupport::Autoload

  autoload :Config, 'api_proxy/config'
  autoload :Middleware, 'api_proxy/middleware'
  autoload :HeadersFilter, 'api_proxy/headers_filter'
  autoload :SignedRequest, 'api_proxy/signed_request'
  autoload :ResponseBuilder, 'api_proxy/response_builder'

  def self.configuration(namespace)
    @configuration ||= {}
    @configuration[namespace] ||= Config.new
  end

  # @example
  #   ApiProxy.setup(:namespace) do |config|
  #     config.api_host = '192.168.99.100'
  #   end
  #
  def self.setup(namespace = :default)
    yield(configuration(namespace))
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
api_proxy-0.2.9 lib/api_proxy.rb