class TwirpRails::ErrorHandlingFactory

Attributes

translator_class[R]

Public Class Methods

enable_handling?() click to toggle source
# File lib/twirp_rails/error_handling/error_handling_factory.rb, line 77
def enable_handling?
  if @enable_handling.nil?
    if (@translator_class = TwirpRails.configuration.twirp_exception_translator_class)
      @translator_class = @translator_class.constantize unless @translator_class.is_a?(Class)
      @enable_handling = true
    else
      @enable_handling = false
    end
  end
  @enable_handling
end
wrap_client(client) click to toggle source
# File lib/twirp_rails/error_handling/error_handling_factory.rb, line 73
def wrap_client(client)
  enable_handling? ? ClientProxy.new(client, translator_class) : client
end
wrap_handler(handler) click to toggle source
# File lib/twirp_rails/error_handling/error_handling_factory.rb, line 69
def wrap_handler(handler)
  enable_handling? ? HandlerProxy.new(handler, translator_class) : handler
end