class Gapic::Schema::Message

Wrapper for a protobuf Message.

@!attribute [r] fields

@ return [Enumerable<Field>] The fields of a message.

@!attribute [r] extensions

@ return [Enumerable<Field>] The extensions of a message.

@!attribute [r] resource

@ return [Resource,nil] A representation of the resource.

@!attribute [r] nested_messages

@ return [Enumerable<Message>] The nested message declarations of a
   message.

@!attribute [r] nested_enums

@ return [Enumerable<Enum>] The nested enum declarations of a message.

Attributes

extensions[R]
fields[R]
nested_enums[R]
nested_messages[R]
resource[R]

Public Class Methods

new(descriptor, address, docs, fields, extensions, resource, nested_messages, nested_enums) click to toggle source

Initializes a message object. @param descriptor [Google::Protobuf::DescriptorProto] the protobuf

representation of this service.

@param address [Enumerable<String>] The address of the proto. See

#address for more info.

@param docs [Google::Protobuf::SourceCodeInfo::Location] The docs

of the proto. See #docs for more info.

@param fields [Enumerable<Field>] The fields of this message. @param extensions [Enumerable<Field>] The extensions of this message. @param resource [Resource,nil] The resource of this message, or nil if none. @param nested_messages [Enumerable<Message>] The nested message

declarations of this message.

@param nested_enums [Enumerable<Enum>] The nested enum declarations

of this message.
Calls superclass method Gapic::Schema::Proto::new
# File lib/gapic/schema/wrappers.rb, line 558
def initialize descriptor, address, docs, fields, extensions, resource,
               nested_messages, nested_enums
  super descriptor, address, docs
  @fields = fields || []
  @extensions = extensions || []
  @resource = resource
  @nested_messages = nested_messages || []
  @nested_enums = nested_enums || []

  @fields.each          { |f| f.parent = self }
  @extensions.each      { |x| x.parent = self }
  @nested_messages.each { |m| m.parent = self }
  @nested_enums.each    { |e| e.parent = self }
  @resource.parent = self if @resource
end

Public Instance Methods

map_entry?() click to toggle source

@return [Boolean] whether this type is a map entry

# File lib/gapic/schema/wrappers.rb, line 575
def map_entry?
  descriptor.options&.map_entry
end