Sha256: 32170cd6d98b337058040f0f22951275330821ca85db6ea8a3e608bd1d21b90e
Contents?: true
Size: 947 Bytes
Versions: 13
Compression:
Stored size: 947 Bytes
Contents
module ThreeScaleToolbox class ThreeScaleClientFactory class << self def get(remotes, remote_str, verify_ssl, verbose = false) new(remotes, remote_str, verify_ssl, verbose).call end end attr_reader :remotes, :remote_str, :verify_ssl, :verbose def initialize(remotes, remote_str, verify_ssl, verbose) @remotes = remotes @remote_str = remote_str @verify_ssl = verify_ssl @verbose = verbose end def call begin remote = Remotes.from_uri(remote_str) rescue InvalidUrlError remote = remotes.fetch(remote_str) end client = remote_client(remote.merge(verify_ssl: verify_ssl)) return ProxyLogger.new(client) if verbose client end private def remote_client(endpoint:, authentication:, verify_ssl:) ThreeScale::API.new(endpoint: endpoint, provider_key: authentication, verify_ssl: verify_ssl) end end end
Version data entries
13 entries across 13 versions & 1 rubygems