class ProtobufDescriptor::MethodDescriptor

Describes a method of a service.

See MethodDescriptorProto

Attributes

method_descriptor_proto[R]

The MethodDescriptorProto this MethodDescriptor is wrapping

parent[R]

The parent {ProtobufDescriptor::ServiceDescriptor}

Public Class Methods

new(parent, method_descriptor_proto) click to toggle source
# File lib/protobuf_descriptor/method_descriptor.rb, line 14
def initialize(parent, method_descriptor_proto)
  @parent = parent
  @method_descriptor_proto = method_descriptor_proto
end

Public Instance Methods

input_type_name() click to toggle source

Input type name for the service method. This is resolved in the same way as FieldDescriptorProto.type_name, but must refer to a message type.

# File lib/protobuf_descriptor/method_descriptor.rb, line 31
def input_type_name
  method_descriptor_proto.input_type
end
name() click to toggle source

The name of the service method

# File lib/protobuf_descriptor/method_descriptor.rb, line 20
def name
  method_descriptor_proto.name
end
options() click to toggle source

The MethodOptions for the service method

# File lib/protobuf_descriptor/method_descriptor.rb, line 25
def options
  method_descriptor_proto.options
end
output_type_name() click to toggle source

Output type name for the service method. This is resolved in the same way as FieldDescriptorProto.type_name, but must refer to a message type.

# File lib/protobuf_descriptor/method_descriptor.rb, line 37
def output_type_name
  method_descriptor_proto.output_type
end
resolve_input_type() click to toggle source

Resolves the method’s input_type_name, returning the {ProtobufDescriptor::MessageDescriptor} that this method receives.

# File lib/protobuf_descriptor/method_descriptor.rb, line 43
def resolve_input_type
  protobuf_descriptor.resolve_type_name(input_type_name, file_descriptor)
end
resolve_output_type() click to toggle source

Resolves the method’s output_type_name, returning the {ProtobufDescriptor::MessageDescriptor} that this method returns.

# File lib/protobuf_descriptor/method_descriptor.rb, line 50
def resolve_output_type
  protobuf_descriptor.resolve_type_name(output_type_name, file_descriptor)
end