class ProtobufDescriptor::MessageDescriptor

Describes a message type.

See DescriptorProto

Attributes

enum_type[R]

The enums that are defined at the top level of this message, as a NamedCollection of {ProtobufDescriptor::EnumDescriptor}

enum_types[R]

The enums that are defined at the top level of this message, as a NamedCollection of {ProtobufDescriptor::EnumDescriptor}

enums[R]

The enums that are defined at the top level of this message, as a NamedCollection of {ProtobufDescriptor::EnumDescriptor}

field[R]

The fields of this message, as a NamedCollection of {ProtobufDescriptor::MessageDescriptor::FieldDescriptor}

fields[R]

The fields of this message, as a NamedCollection of {ProtobufDescriptor::MessageDescriptor::FieldDescriptor}

message_descriptor_proto[R]

The MessageDescriptorProto this MessageDescriptor is wrapping.

messages[R]

The messages that are defined at the top level of this message, as a NamedCollection of {ProtobufDescriptor::MessageDescriptor}

nested_type[R]

The messages that are defined at the top level of this message, as a NamedCollection of {ProtobufDescriptor::MessageDescriptor}

nested_types[R]

The messages that are defined at the top level of this message, as a NamedCollection of {ProtobufDescriptor::MessageDescriptor}

parent[R]

The containing {ProtobufDescriptor::FileDescriptor} or {ProtobufDescriptor::MessageDescriptor} that defines this message.

Public Class Methods

new(parent, message_descriptor_proto) click to toggle source
# File lib/protobuf_descriptor/message_descriptor.rb, line 41
def initialize(parent, message_descriptor_proto)
  @parent = parent
  @message_descriptor_proto = message_descriptor_proto

  @nested_type = ProtobufDescriptor::NamedCollection.new(
      message_descriptor_proto.nested_type.map { |m|
          ProtobufDescriptor::MessageDescriptor.new(self, m)
      })

  @enum_type = ProtobufDescriptor::NamedCollection.new(
      message_descriptor_proto.enum_type.map { |m|
          ProtobufDescriptor::EnumDescriptor.new(self, m)
      })

  @field = ProtobufDescriptor::NamedCollection.new(
      message_descriptor_proto.field.map { |m|
          ProtobufDescriptor::FieldDescriptor.new(self, m)
      })
end

Public Instance Methods

extension() click to toggle source

The extensions defined for this message

# File lib/protobuf_descriptor/message_descriptor.rb, line 73
def extension
  message_descriptor_proto.extension
end
Also aliased as: extensions
extension_range() click to toggle source

The extension ranges defined for this message

# File lib/protobuf_descriptor/message_descriptor.rb, line 67
def extension_range
  message_descriptor_proto.extension_range
end
Also aliased as: extension_ranges
extension_ranges()
Alias for: extension_range
extensions()
Alias for: extension
name() click to toggle source

The name of the message

# File lib/protobuf_descriptor/message_descriptor.rb, line 79
def name
  message_descriptor_proto.name
end
options() click to toggle source

The MessageOptions defined for this message.

# File lib/protobuf_descriptor/message_descriptor.rb, line 62
def options
  message_descriptor_proto.options
end