Module: Nucleus::AdapterAuthenticationInductor

Includes:
Logging
Defined in:
lib/nucleus/core/adapter_authentication_inductor.rb

Overview

The AdapterAuthenticationInductor patches adapter classes so that each method that is defined in the AdapterStub of the current API version is wrapped with the Nucleus::Adapters::AuthenticationRetryWrapper.

Class Method Summary collapse

Methods included from Logging

configure_logger_for, #log, logger_for

Class Method Details

.patch(adapter_instance, env) ⇒ void

This method returns an undefined value.

Patch the adapter instance and use the authentication information of the environment.

Parameters:

  • adapter_instance (Nucleus::Adapters::BaseAdapter)

    the adapter implementation instance to patch

  • env (Hash<String, String>)

    environment which includes the HTTP authentication header



11
12
13
14
15
16
# File 'lib/nucleus/core/adapter_authentication_inductor.rb', line 11

def self.patch(adapter_instance, env)
  stub_class(adapter_instance).instance_methods(false).each do |method_to_wrap|
    # wrap method with authentication repetition call
    patch_method(adapter_instance, method_to_wrap, env)
  end
end