Class: ProtoPlugin::MethodDescriptor

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/proto_plugin/method_descriptor.rb

Overview

A wrapper class around Google::Protobuf::MethodDescriptorProto which provides helpers and more idiomatic Ruby access patterns.

Any method not defined directly is delegated to the descriptor the wrapper was initialized with.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(descriptor, service) ⇒ MethodDescriptor

Returns a new instance of MethodDescriptor.

Parameters:

  • descriptor (Google::Protobuf::MethodDescriptorProto)
  • service (ServiceDescriptor)

    The service this method was defined in.



23
24
25
26
27
# File 'lib/proto_plugin/method_descriptor.rb', line 23

def initialize(descriptor, service)
  super(descriptor)
  @descriptor = descriptor
  @service = service
end

Instance Attribute Details

#descriptorGoogle::Protobuf::MethodDescriptorProto (readonly)

Returns:

  • (Google::Protobuf::MethodDescriptorProto)


14
15
16
# File 'lib/proto_plugin/method_descriptor.rb', line 14

def descriptor
  @descriptor
end

#serviceServiceDescriptor (readonly)

The service this method was defined in.

Returns:



19
20
21
# File 'lib/proto_plugin/method_descriptor.rb', line 19

def service
  @service
end