Module: ProtoPharm::Introspection::ServiceResolver

Defined in:
lib/proto_pharm/introspection/service_resolver.rb

Defined Under Namespace

Classes: InvalidGRPCServiceError

Class Method Summary collapse

Class Method Details

.resolve(service) ⇒ Object



9
10
11
12
13
# File 'lib/proto_pharm/introspection/service_resolver.rb', line 9

def resolve(service)
  raise InvalidGRPCServiceError, "Not a valid gRPC service module: #{service.inspect}" unless service.respond_to?(:const_defined?)

  service.const_defined?(:Service) ? service::Service : service
end