Class: Nonnative::ProxyFactory
- Inherits:
-
Object
- Object
- Nonnative::ProxyFactory
- Defined in:
- lib/nonnative/proxy_factory.rb
Overview
Factory for creating proxy instances for services.
A runtime service constructs a proxy via this factory. The proxy implementation is selected by
service.proxy.kind and resolved using proxy.
If the kind is "none", proxy returns NoProxy.
Unknown non-"none" kinds raise an error so proxy configuration typos do not silently disable
fault injection.
Class Method Summary collapse
-
.create(service) ⇒ Nonnative::Proxy
Creates a proxy instance for the given service configuration.
Class Method Details
.create(service) ⇒ Nonnative::Proxy
Creates a proxy instance for the given service configuration.
23 24 25 26 27 |
# File 'lib/nonnative/proxy_factory.rb', line 23 def create(service) proxy = Nonnative.proxy(service.proxy.kind) proxy.new(service) end |