Class: ProtobufDescriptor::ServiceDescriptor::MethodDescriptor
- Inherits:
-
Object
- Object
- ProtobufDescriptor::ServiceDescriptor::MethodDescriptor
- Includes:
- HasParent
- Defined in:
- lib/protobuf_descriptor/service_descriptor.rb
Overview
Describes a method of a service.
Instance Attribute Summary collapse
-
#method_descriptor_proto ⇒ Object
readonly
The
MethodDescriptorProto
thisMethodDescriptor
is wrapping. -
#parent ⇒ Object
readonly
The parent ServiceDescriptor.
Instance Method Summary collapse
-
#initialize(parent, method_descriptor_proto) ⇒ MethodDescriptor
constructor
A new instance of MethodDescriptor.
-
#input_type_name ⇒ Object
Input type name for the service method.
-
#name ⇒ Object
The name of the service method.
-
#options ⇒ Object
The
MethodOptions
for the service method. -
#output_type_name ⇒ Object
Output type name for the service method.
-
#resolve_input_type ⇒ Object
Resolves the method’s
input_type_name
, returning the MessageDescriptor that this method receives. -
#resolve_output_type ⇒ Object
Resolves the method’s
output_type_name
, returning the MessageDescriptor that this method returns.
Methods included from HasParent
#file_descriptor, #protobuf_descriptor
Constructor Details
#initialize(parent, method_descriptor_proto) ⇒ MethodDescriptor
Returns a new instance of MethodDescriptor.
22 23 24 25 |
# File 'lib/protobuf_descriptor/service_descriptor.rb', line 22 def initialize(parent, method_descriptor_proto) @parent = parent @method_descriptor_proto = method_descriptor_proto end |
Instance Attribute Details
#method_descriptor_proto ⇒ Object (readonly)
The MethodDescriptorProto
this MethodDescriptor
is wrapping
20 21 22 |
# File 'lib/protobuf_descriptor/service_descriptor.rb', line 20 def method_descriptor_proto @method_descriptor_proto end |
#parent ⇒ Object (readonly)
The parent ServiceDescriptor
17 18 19 |
# File 'lib/protobuf_descriptor/service_descriptor.rb', line 17 def parent @parent end |
Instance Method Details
#input_type_name ⇒ Object
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.
41 42 43 |
# File 'lib/protobuf_descriptor/service_descriptor.rb', line 41 def input_type_name method_descriptor_proto.input_type end |
#name ⇒ Object
The name of the service method
30 31 32 |
# File 'lib/protobuf_descriptor/service_descriptor.rb', line 30 def name method_descriptor_proto.name end |
#options ⇒ Object
The MethodOptions
for the service method
35 36 37 |
# File 'lib/protobuf_descriptor/service_descriptor.rb', line 35 def method_descriptor_proto. end |
#output_type_name ⇒ Object
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.
47 48 49 |
# File 'lib/protobuf_descriptor/service_descriptor.rb', line 47 def output_type_name method_descriptor_proto.output_type end |
#resolve_input_type ⇒ Object
Resolves the method’s input_type_name
, returning the MessageDescriptor that this method receives.
54 55 56 |
# File 'lib/protobuf_descriptor/service_descriptor.rb', line 54 def resolve_input_type protobuf_descriptor.resolve_type_name(input_type_name, file_descriptor) end |
#resolve_output_type ⇒ Object
Resolves the method’s output_type_name
, returning the MessageDescriptor that this method returns.
61 62 63 |
# File 'lib/protobuf_descriptor/service_descriptor.rb', line 61 def resolve_output_type protobuf_descriptor.resolve_type_name(output_type_name, file_descriptor) end |