Class: ProtobufDescriptor::MessageDescriptor
- Inherits:
-
Object
- Object
- ProtobufDescriptor::MessageDescriptor
- Includes:
- HasChildren, HasParent, NamedChild
- Defined in:
- lib/protobuf_descriptor/message_descriptor.rb
Overview
Describes a message type.
See DescriptorProto[https://code.google.com/p/protobuf/source/browse/trunk/src/google/protobuf/descriptor.proto#84]
Instance Attribute Summary collapse
-
#enum_type ⇒ Object
(also: #enum_types, #enums)
readonly
The enums that are defined at the top level of this message, as a NamedCollection of EnumDescriptor.
-
#field ⇒ Object
(also: #fields)
readonly
The fields of this message, as a NamedCollection of FieldDescriptor.
-
#message_descriptor_proto ⇒ Object
readonly
The +MessageDescriptorProto+ this +MessageDescriptor+ is wrapping.
-
#nested_type ⇒ Object
(also: #nested_types, #messages)
readonly
The messages that are defined at the top level of this message, as a NamedCollection of MessageDescriptor.
-
#parent ⇒ Object
readonly
The containing FileDescriptor or MessageDescriptor that defines this message.
Instance Method Summary collapse
-
#extension ⇒ Object
(also: #extensions)
The extensions defined for this message.
-
#extension_range ⇒ Object
(also: #extension_ranges)
The extension ranges defined for this message.
-
#initialize(parent, message_descriptor_proto) ⇒ MessageDescriptor
constructor
A new instance of MessageDescriptor.
-
#name ⇒ Object
The name of the message.
-
#options ⇒ Object
The +MessageOptions+ defined for this message.
Methods included from HasChildren
#compute_source_code_info_path_component, included, #named_children
Methods included from NamedChild
#fully_qualified_java_name, #fully_qualified_name, #fully_qualified_ruby_name, #fully_qualified_wire_name, #inspect
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, message_descriptor_proto) ⇒ MessageDescriptor
Returns a new instance of MessageDescriptor.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/protobuf_descriptor/message_descriptor.rb', line 41 def initialize(parent, ) @parent = parent = @nested_type = ProtobufDescriptor::NamedCollection.new( .nested_type.map { |m| ProtobufDescriptor::MessageDescriptor.new(self, m) }) @enum_type = ProtobufDescriptor::NamedCollection.new( .enum_type.map { |m| ProtobufDescriptor::EnumDescriptor.new(self, m) }) @field = ProtobufDescriptor::NamedCollection.new( .field.map { |m| ProtobufDescriptor::FieldDescriptor.new(self, m) }) end |
Instance Attribute Details
#enum_type ⇒ Object (readonly) Also known as: enum_types, enums
The enums that are defined at the top level of this message, as a NamedCollection of EnumDescriptor
26 27 28 |
# File 'lib/protobuf_descriptor/message_descriptor.rb', line 26 def enum_type @enum_type end |
#field ⇒ Object (readonly) Also known as: fields
The fields of this message, as a NamedCollection of FieldDescriptor
32 33 34 |
# File 'lib/protobuf_descriptor/message_descriptor.rb', line 32 def field @field end |
#message_descriptor_proto ⇒ Object (readonly)
The +MessageDescriptorProto+ this +MessageDescriptor+ is wrapping.
16 17 18 |
# File 'lib/protobuf_descriptor/message_descriptor.rb', line 16 def end |
#nested_type ⇒ Object (readonly) Also known as: nested_types, messages
The messages that are defined at the top level of this message, as a NamedCollection of ProtobufDescriptor::MessageDescriptor
20 21 22 |
# File 'lib/protobuf_descriptor/message_descriptor.rb', line 20 def nested_type @nested_type end |
#parent ⇒ Object (readonly)
The containing FileDescriptor or ProtobufDescriptor::MessageDescriptor that defines this message.
13 14 15 |
# File 'lib/protobuf_descriptor/message_descriptor.rb', line 13 def parent @parent end |
Instance Method Details
#extension ⇒ Object Also known as: extensions
The extensions defined for this message
73 74 75 |
# File 'lib/protobuf_descriptor/message_descriptor.rb', line 73 def extension .extension end |
#extension_range ⇒ Object Also known as: extension_ranges
The extension ranges defined for this message
67 68 69 |
# File 'lib/protobuf_descriptor/message_descriptor.rb', line 67 def extension_range .extension_range end |
#name ⇒ Object
The name of the message
79 80 81 |
# File 'lib/protobuf_descriptor/message_descriptor.rb', line 79 def name .name end |
#options ⇒ Object
The +MessageOptions+ defined for this message.
62 63 64 |
# File 'lib/protobuf_descriptor/message_descriptor.rb', line 62 def . end |