Class: ProtobufDescriptor::MethodDescriptor
- Inherits:
-
Object
- Object
- ProtobufDescriptor::MethodDescriptor
- Includes:
- HasParent
- Defined in:
- lib/protobuf_descriptor/method_descriptor.rb
Overview
Describes a method of a service.
See MethodDescriptorProto[https://code.google.com/p/protobuf/source/browse/trunk/src/google/protobuf/descriptor.proto#196]
Instance Attribute Summary collapse
-
#method_descriptor_proto ⇒ Object
readonly
The +MethodDescriptorProto+ this +MethodDescriptor+ 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
#compute_source_code_info_path, #file_descriptor, #leading_comments, #protobuf_descriptor, #source_code_info_location, #source_code_info_locations, #source_code_info_span, #trailing_comments
Constructor Details
#initialize(parent, method_descriptor_proto) ⇒ MethodDescriptor
Returns a new instance of MethodDescriptor.
14 15 16 17 |
# File 'lib/protobuf_descriptor/method_descriptor.rb', line 14 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
12 13 14 |
# File 'lib/protobuf_descriptor/method_descriptor.rb', line 12 def method_descriptor_proto @method_descriptor_proto end |
#parent ⇒ Object (readonly)
The parent ServiceDescriptor
9 10 11 |
# File 'lib/protobuf_descriptor/method_descriptor.rb', line 9 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.
31 32 33 |
# File 'lib/protobuf_descriptor/method_descriptor.rb', line 31 def input_type_name method_descriptor_proto.input_type end |
#name ⇒ Object
The name of the service method
20 21 22 |
# File 'lib/protobuf_descriptor/method_descriptor.rb', line 20 def name method_descriptor_proto.name end |
#options ⇒ Object
The +MethodOptions+ for the service method
25 26 27 |
# File 'lib/protobuf_descriptor/method_descriptor.rb', line 25 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.
37 38 39 |
# File 'lib/protobuf_descriptor/method_descriptor.rb', line 37 def output_type_name method_descriptor_proto.output_type end |
#resolve_input_type ⇒ Object
Resolves the method's +input_type_name+, returning the ProtobufDescriptor::MessageDescriptor that this method receives.
43 44 45 |
# 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 ⇒ Object
Resolves the method's +output_type_name+, returning the ProtobufDescriptor::MessageDescriptor that this method returns.
50 51 52 |
# File 'lib/protobuf_descriptor/method_descriptor.rb', line 50 def resolve_output_type protobuf_descriptor.resolve_type_name(output_type_name, file_descriptor) end |