class GRPC::InterceptorRegistry

Represents a registry of added interceptors available for enumeration. The registry can be used for both server and client interceptors. This class is internal to gRPC and not meant for public usage.

Public Class Methods

new(interceptors = []) click to toggle source

Initialize the registry with an empty interceptor list This is an EXPERIMENTAL API.

# File src/ruby/lib/grpc/generic/interceptor_registry.rb, line 33
def initialize(interceptors = [])
  @interceptors = []
  interceptors.each do |i|
    base = GRPC::Interceptor
    unless i.class.ancestors.include?(base)
      fail DescendantError, "Interceptors must descend from #{base}"
    end
    @interceptors << i
  end
end

Public Instance Methods

build_context() click to toggle source

Builds an interception context from this registry

@return [InterceptionContext]

# File src/ruby/lib/grpc/generic/interceptor_registry.rb, line 49
def build_context
  InterceptionContext.new(@interceptors)
end