iterator;
+
/** The current ByteBuffer; */
private ByteBuffer currentByteBuffer;
+
/** The number of ByteBuffers in the input data. */
private int dataSize;
+
/**
* Current {@code ByteBuffer}'s index
*
* If index equals dataSize, then all the data in the InputStream has been consumed
*/
private int currentIndex;
+
/** The current position for current ByteBuffer */
private int currentByteBufferPos;
+
/** Whether current ByteBuffer has an array */
private boolean hasArray;
+
/**
* If the current ByteBuffer is unsafe-direct based, currentArray is null; otherwise should be the
* array inside ByteBuffer.
*/
private byte[] currentArray;
+
/** Current ByteBuffer's array offset */
private int currentArrayOffset;
+
/**
* If the current ByteBuffer is unsafe-direct based, currentAddress is the start address of this
* ByteBuffer; otherwise should be zero.
diff --git a/objectivec/DevTools/check_version_stamps.sh b/objectivec/DevTools/check_version_stamps.sh
index 8b6d496a06744..184215d4e848f 100755
--- a/objectivec/DevTools/check_version_stamps.sh
+++ b/objectivec/DevTools/check_version_stamps.sh
@@ -28,7 +28,7 @@ check_constant() {
# Collect version from generator sources.
local GeneratorVersion=$( \
cat "${GeneratorSrc}" \
- | sed -n -e "s:const int32_t ${ConstantName} = \([0-9]*\);:\1:p"
+ | sed -n -e "s:^const int32_t ${ConstantName} = \([0-9]*\);:\1:p"
)
if [[ -z "${GeneratorVersion}" ]] ; then
die "Failed to find ${ConstantName} in the generator source (${GeneratorSrc})."
@@ -37,7 +37,7 @@ check_constant() {
# Collect version from runtime sources.
local RuntimeVersion=$( \
cat "${RuntimeSrc}" \
- | sed -n -e "s:#define ${ConstantName} \([0-9]*\):\1:p"
+ | sed -n -e "s:^#define ${ConstantName} \([0-9]*\):\1:p"
)
if [[ -z "${RuntimeVersion}" ]] ; then
die "Failed to find ${ConstantName} in the runtime source (${RuntimeSrc})."
diff --git a/objectivec/Tests/GPBObjectiveCPlusPlusTest.mm b/objectivec/Tests/GPBObjectiveCPlusPlusTest.mm
index 96351e0dcad65..80ec66afe9ba3 100644
--- a/objectivec/Tests/GPBObjectiveCPlusPlusTest.mm
+++ b/objectivec/Tests/GPBObjectiveCPlusPlusTest.mm
@@ -24,11 +24,6 @@
// Sanity check the conditions of the test within the Xcode project.
#if !__cplusplus
#error This isn't compiled as Objective C++?
-#elif __cplusplus >= 201103L
-// If this trips, it means the Xcode default might have change (or someone
-// edited the testing project) and it might be time to revisit the GPB_ENUM
-// define in GPBBootstrap.h.
-#warning Did the Xcode default for C++ spec change?
#endif
// Dummy XCTest.
diff --git a/objectivec/Tests/GPBTestUtilities.m b/objectivec/Tests/GPBTestUtilities.m
index 99a270c2c8d99..3f4f39f86314e 100644
--- a/objectivec/Tests/GPBTestUtilities.m
+++ b/objectivec/Tests/GPBTestUtilities.m
@@ -33,7 +33,7 @@ - (instancetype)initWithUint32_gpbtu:(uint32_t)value {
}
+ (instancetype)gpbtu_dataWithEmbeddedNulls {
- char bytes[6] = "\1\0\2\3\0\5";
+ char bytes[6] = {'\1', '\0', '\2', '\3', '\0', '\5'};
return [self dataWithBytes:bytes length:sizeof(bytes)];
}
@end
diff --git a/php/ext/google/protobuf/php-upb.c b/php/ext/google/protobuf/php-upb.c
index f30f492a1deaf..888af41ee9add 100644
--- a/php/ext/google/protobuf/php-upb.c
+++ b/php/ext/google/protobuf/php-upb.c
@@ -6955,18 +6955,6 @@ static const upb_MiniTableEnum* _upb_MiniTableSubs_EnumByField(
return subs[field->UPB_PRIVATE(submsg_index)].UPB_PRIVATE(subenum);
}
-UPB_NORETURN static void* _upb_Decoder_ErrorJmp(upb_Decoder* d,
- upb_DecodeStatus status) {
- UPB_ASSERT(status != kUpb_DecodeStatus_Ok);
- d->status = status;
- UPB_LONGJMP(d->err, 1);
-}
-
-const char* _upb_FastDecoder_ErrorJmp2(upb_Decoder* d) {
- UPB_LONGJMP(d->err, 1);
- return NULL;
-}
-
static void _upb_Decoder_VerifyUtf8(upb_Decoder* d, const char* buf, int len) {
if (!_upb_Decoder_VerifyUtf8Inline(buf, len)) {
_upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_BadUtf8);
@@ -7618,18 +7606,6 @@ static const char* _upb_Decoder_DecodeToSubMessage(
return ptr;
}
-UPB_NOINLINE
-const char* _upb_Decoder_CheckRequired(upb_Decoder* d, const char* ptr,
- const upb_Message* msg,
- const upb_MiniTable* m) {
- UPB_ASSERT(m->UPB_PRIVATE(required_count));
- if (UPB_UNLIKELY(d->options & kUpb_DecodeOption_CheckRequired)) {
- d->missing_required =
- !UPB_PRIVATE(_upb_Message_IsInitializedShallow)(msg, m);
- }
- return ptr;
-}
-
static const char* upb_Decoder_SkipField(upb_Decoder* d, const char* ptr,
uint32_t tag) {
int field_number = tag >> 3;
@@ -8232,13 +8208,6 @@ static upb_DecodeStatus _upb_Decoder_DecodeTop(struct upb_Decoder* d,
return kUpb_DecodeStatus_Ok;
}
-UPB_NOINLINE
-const char* _upb_Decoder_IsDoneFallback(upb_EpsCopyInputStream* e,
- const char* ptr, int overrun) {
- return _upb_EpsCopyInputStream_IsDoneFallbackInline(
- e, ptr, overrun, _upb_Decoder_BufferFlipCallback);
-}
-
static upb_DecodeStatus upb_Decoder_Decode(upb_Decoder* const decoder,
const char* const buf,
upb_Message* const msg,
@@ -8451,8 +8420,9 @@ static char* encode_fixed32(char* ptr, upb_encstate* e, uint32_t val) {
#define UPB_PB_VARINT_MAX_LEN 10
-// Need gnu extended inline asm
-#if defined(__aarch64__) && (defined(__GNUC__) || defined(__clang__))
+// Need gnu extended inline asm; msan can't instrument stores in inline assembly
+#if defined(__aarch64__) && (defined(__GNUC__) || defined(__clang__)) && \
+ !UPB_HAS_FEATURE(memory_sanitizer)
#define UPB_ARM64_ASM
#endif
@@ -17443,6 +17413,36 @@ upb_ServiceDef* _upb_ServiceDefs_New(upb_DefBuilder* ctx, int n,
return s;
}
+
+
+// Must be last.
+
+UPB_NOINLINE
+const char* _upb_Decoder_CheckRequired(upb_Decoder* d, const char* ptr,
+ const upb_Message* msg,
+ const upb_MiniTable* m) {
+ UPB_ASSERT(m->UPB_PRIVATE(required_count));
+ if (UPB_UNLIKELY(d->options & kUpb_DecodeOption_CheckRequired)) {
+ d->missing_required =
+ !UPB_PRIVATE(_upb_Message_IsInitializedShallow)(msg, m);
+ }
+ return ptr;
+}
+
+UPB_NORETURN void* _upb_Decoder_ErrorJmp(upb_Decoder* d,
+ upb_DecodeStatus status) {
+ UPB_ASSERT(status != kUpb_DecodeStatus_Ok);
+ d->status = status;
+ UPB_LONGJMP(d->err, 1);
+}
+
+UPB_NOINLINE
+const char* _upb_Decoder_IsDoneFallback(upb_EpsCopyInputStream* e,
+ const char* ptr, int overrun) {
+ return _upb_EpsCopyInputStream_IsDoneFallbackInline(
+ e, ptr, overrun, _upb_Decoder_BufferFlipCallback);
+}
+
// This should #undef all macros #defined in def.inc
#undef UPB_SIZE
diff --git a/php/ext/google/protobuf/php-upb.h b/php/ext/google/protobuf/php-upb.h
index 92fc353b6ead2..627cf284cd3a9 100644
--- a/php/ext/google/protobuf/php-upb.h
+++ b/php/ext/google/protobuf/php-upb.h
@@ -5683,6 +5683,8 @@ bool upb_Message_SetMapEntry(upb_Map* map, const upb_MiniTable* mini_table,
#ifndef UPB_MINI_TABLE_DECODE_H_
#define UPB_MINI_TABLE_DECODE_H_
+#include
+
#ifndef UPB_MINI_TABLE_SUB_H_
#define UPB_MINI_TABLE_SUB_H_
@@ -5877,7 +5879,7 @@ UPB_API_INLINE upb_MiniTableExtension* upb_MiniTableExtension_Build(
UPB_API_INLINE upb_MiniTableExtension* upb_MiniTableExtension_BuildMessage(
const char* data, size_t len, const upb_MiniTable* extendee,
- upb_MiniTable* submsg, upb_Arena* arena, upb_Status* status) {
+ const upb_MiniTable* submsg, upb_Arena* arena, upb_Status* status) {
upb_MiniTableSub sub = upb_MiniTableSub_FromMessage(submsg);
return _upb_MiniTableExtension_Build(
data, len, extendee, sub, kUpb_MiniTablePlatform_Native, arena, status);
@@ -5885,7 +5887,7 @@ UPB_API_INLINE upb_MiniTableExtension* upb_MiniTableExtension_BuildMessage(
UPB_API_INLINE upb_MiniTableExtension* upb_MiniTableExtension_BuildEnum(
const char* data, size_t len, const upb_MiniTable* extendee,
- upb_MiniTableEnum* subenum, upb_Arena* arena, upb_Status* status) {
+ const upb_MiniTableEnum* subenum, upb_Arena* arena, upb_Status* status) {
upb_MiniTableSub sub = upb_MiniTableSub_FromEnum(subenum);
return _upb_MiniTableExtension_Build(
data, len, extendee, sub, kUpb_MiniTablePlatform_Native, arena, status);
@@ -15617,21 +15619,6 @@ UPB_INLINE void _upb_Decoder_Trace(upb_Decoder* d, char event) {
#endif
};
-/* Error function that will abort decoding with longjmp(). We can't declare this
- * UPB_NORETURN, even though it is appropriate, because if we do then compilers
- * will "helpfully" refuse to tailcall to it
- * (see: https://stackoverflow.com/a/55657013), which will defeat a major goal
- * of our optimizations. That is also why we must declare it in a separate file,
- * otherwise the compiler will see that it calls longjmp() and deduce that it is
- * noreturn. */
-const char* _upb_FastDecoder_ErrorJmp2(upb_Decoder* d);
-
-UPB_INLINE
-const char* _upb_FastDecoder_ErrorJmp(upb_Decoder* d, upb_DecodeStatus status) {
- d->status = status;
- return _upb_FastDecoder_ErrorJmp2(d);
-}
-
UPB_INLINE
bool _upb_Decoder_VerifyUtf8Inline(const char* ptr, int len) {
return utf8_range_IsValid(ptr, len);
@@ -15663,10 +15650,13 @@ UPB_INLINE bool _upb_Decoder_IsDone(upb_Decoder* d, const char** ptr) {
&d->input, ptr, &_upb_Decoder_IsDoneFallback);
}
+UPB_NORETURN void* _upb_Decoder_ErrorJmp(upb_Decoder* d,
+ upb_DecodeStatus status);
+
UPB_INLINE const char* _upb_Decoder_BufferFlipCallback(
upb_EpsCopyInputStream* e, const char* old_end, const char* new_start) {
upb_Decoder* d = (upb_Decoder*)e;
- if (!old_end) _upb_FastDecoder_ErrorJmp(d, kUpb_DecodeStatus_Malformed);
+ if (!old_end) _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_Malformed);
return new_start;
}
diff --git a/protobuf_deps.bzl b/protobuf_deps.bzl
index 31d5506d33d8a..fb607859bd553 100644
--- a/protobuf_deps.bzl
+++ b/protobuf_deps.bzl
@@ -141,9 +141,9 @@ def protobuf_deps():
if not native.existing_rule("rules_python"):
http_archive(
name = "rules_python",
- sha256 = "4f7e2aa1eb9aa722d96498f5ef514f426c1f55161c3c9ae628c857a7128ceb07",
- strip_prefix = "rules_python-1.0.0",
- url = "https://github.com/bazelbuild/rules_python/releases/download/1.0.0/rules_python-1.0.0.tar.gz",
+ sha256 = "9c6e26911a79fbf510a8f06d8eedb40f412023cf7fa6d1461def27116bff022c",
+ strip_prefix = "rules_python-1.1.0",
+ url = "https://github.com/bazelbuild/rules_python/releases/download/1.1.0/rules_python-1.1.0.tar.gz",
)
if not native.existing_rule("system_python"):
@@ -155,9 +155,9 @@ def protobuf_deps():
if not native.existing_rule("rules_jvm_external"):
http_archive(
name = "rules_jvm_external",
- strip_prefix = "rules_jvm_external-6.3",
- sha256 = "c18a69d784bcd851be95897ca0eca0b57dc86bb02e62402f15736df44160eb02",
- url = "https://github.com/bazelbuild/rules_jvm_external/releases/download/6.3/rules_jvm_external-6.3.tar.gz",
+ strip_prefix = "rules_jvm_external-6.7",
+ sha256 = "a1e351607f04fed296ba33c4977d3fe2a615ed50df7896676b67aac993c53c18",
+ url = "https://github.com/bazelbuild/rules_jvm_external/releases/download/6.7/rules_jvm_external-6.7.tar.gz",
)
if not native.existing_rule("rules_pkg"):
diff --git a/python/BUILD.bazel b/python/BUILD.bazel
index f1c384a8f2191..e8c94aecff63e 100644
--- a/python/BUILD.bazel
+++ b/python/BUILD.bazel
@@ -148,18 +148,18 @@ py_extension(
deps = [
"//src/google/protobuf:descriptor_upb_reflection_proto",
"//third_party/utf8_range",
- "//upb:base",
- "//upb:eps_copy_input_stream",
- "//upb:message",
- "//upb:message_compare",
- "//upb:message_copy",
- "//upb:port",
- "//upb:reflection",
- "//upb:text",
- "//upb:wire_reader",
+ "//upb/base",
"//upb/hash",
+ "//upb/message",
+ "//upb/message:compare",
+ "//upb/message:copy",
+ "//upb/port",
+ "//upb/reflection",
+ "//upb/text",
"//upb/util:def_to_proto",
"//upb/util:required_fields",
+ "//upb/wire:eps_copy_input_stream",
+ "//upb/wire:reader",
"@abseil-cpp//absl/base:core_headers",
],
)
diff --git a/python/descriptor_containers.c b/python/descriptor_containers.c
index 47a00e4d9b2af..00aee2dc6bd46 100644
--- a/python/descriptor_containers.c
+++ b/python/descriptor_containers.c
@@ -24,6 +24,10 @@ static PyObject* PyUpb_DescriptorMap_Repr(PyObject* _self) {
return ret;
}
+#define CHECK_TYPE(obj, state_member) \
+ assert(PyUpb_ModuleState_MaybeGet() == NULL || /* During shutdown. */ \
+ Py_TYPE(obj) == PyUpb_ModuleState_Get()->state_member)
+
// -----------------------------------------------------------------------------
// ByNameIterator
// -----------------------------------------------------------------------------
@@ -39,7 +43,7 @@ typedef struct {
} PyUpb_ByNameIterator;
static PyUpb_ByNameIterator* PyUpb_ByNameIterator_Self(PyObject* obj) {
- assert(Py_TYPE(obj) == PyUpb_ModuleState_Get()->by_name_iterator_type);
+ CHECK_TYPE(obj, by_name_iterator_type);
return (PyUpb_ByNameIterator*)obj;
}
@@ -101,7 +105,7 @@ typedef struct {
} PyUpb_ByNumberIterator;
static PyUpb_ByNumberIterator* PyUpb_ByNumberIterator_Self(PyObject* obj) {
- assert(Py_TYPE(obj) == PyUpb_ModuleState_Get()->by_number_iterator_type);
+ CHECK_TYPE(obj, by_number_iterator_type);
return (PyUpb_ByNumberIterator*)obj;
}
@@ -162,7 +166,7 @@ typedef struct {
} PyUpb_GenericSequence;
PyUpb_GenericSequence* PyUpb_GenericSequence_Self(PyObject* obj) {
- assert(Py_TYPE(obj) == PyUpb_ModuleState_Get()->generic_sequence_type);
+ CHECK_TYPE(obj, generic_sequence_type);
return (PyUpb_GenericSequence*)obj;
}
@@ -357,7 +361,7 @@ typedef struct {
} PyUpb_ByNameMap;
PyUpb_ByNameMap* PyUpb_ByNameMap_Self(PyObject* obj) {
- assert(Py_TYPE(obj) == PyUpb_ModuleState_Get()->by_name_map_type);
+ CHECK_TYPE(obj, by_name_map_type);
return (PyUpb_ByNameMap*)obj;
}
@@ -573,7 +577,7 @@ typedef struct {
} PyUpb_ByNumberMap;
PyUpb_ByNumberMap* PyUpb_ByNumberMap_Self(PyObject* obj) {
- assert(Py_TYPE(obj) == PyUpb_ModuleState_Get()->by_number_map_type);
+ CHECK_TYPE(obj, by_number_map_type);
return (PyUpb_ByNumberMap*)obj;
}
diff --git a/python/google/protobuf/internal/reflection_test.py b/python/google/protobuf/internal/reflection_test.py
index 150e48abb8ed8..4a9dba797b8aa 100755
--- a/python/google/protobuf/internal/reflection_test.py
+++ b/python/google/protobuf/internal/reflection_test.py
@@ -3144,7 +3144,7 @@ def testFieldProperties(self):
with self.assertRaises(AttributeError) as e:
# Try to access the descriptor of the field 'optional_int32'
cls.optional_int32.DESCRIPTOR
- self.assertEquals('optional_int32', str(e.exception))
+ self.assertEqual('optional_int32', str(e.exception))
else:
self.assertIs(
cls.optional_int32.DESCRIPTOR,
diff --git a/ruby/.yardopts b/ruby/.yardopts
new file mode 100644
index 0000000000000..ed0dbff549e4d
--- /dev/null
+++ b/ruby/.yardopts
@@ -0,0 +1,4 @@
+--no-private
+lib/stubs/*.rb
+lib/google/protobuf/well_known_types.rb
+lib/google/protobuf.rb
diff --git a/ruby/README.md b/ruby/README.md
index e5b5bb3cf59d4..75ee34679e194 100644
--- a/ruby/README.md
+++ b/ruby/README.md
@@ -26,9 +26,8 @@ main `README` file. The version of `protoc` included in the latest release
supports the `--ruby_out` option to generate Ruby code.
A simple example of using the Ruby extension follows. More extensive
-documentation may be found in the RubyDoc comments (`call-seq` tags) in the
-source, and we plan to release separate, more detailed, documentation at a
-later date.
+documentation may be found on
+[rubydoc.info](https://www.rubydoc.info/gems/google-protobuf).
```ruby
require 'google/protobuf'
diff --git a/ruby/Rakefile b/ruby/Rakefile
index 36254664fa263..862aaf862c615 100644
--- a/ruby/Rakefile
+++ b/ruby/Rakefile
@@ -206,7 +206,11 @@ Rake::TestTask.new(:gc_test => ENV['BAZEL'] == 'true' ? [] : :build) do |t|
t.test_files = FileList["tests/gc_test.rb"]
end
-task :build => [:clean, :genproto, :copy_third_party, :compile, :"ffi-protobuf:default"]
+task :generate_stubs do
+ load './generate_stubs.rb'
+end
+
+task :build => [:clean, :genproto, :copy_third_party, :compile, :generate_stubs, :"ffi-protobuf:default"]
Rake::Task[:gem].enhance [:copy_third_party, :genproto]
task :default => [:build]
diff --git a/ruby/ext/google/protobuf_c/defs.c b/ruby/ext/google/protobuf_c/defs.c
index fd17093891fe7..e771e44722638 100644
--- a/ruby/ext/google/protobuf_c/defs.c
+++ b/ruby/ext/google/protobuf_c/defs.c
@@ -93,9 +93,15 @@ const upb_DefPool* DescriptorPool_GetSymtab(VALUE desc_pool_rb) {
return pool->symtab;
}
+/**
+ * ruby-doc: DescriptorPool
+ *
+ * A DescriptorPool is the registry of all known Protobuf descriptor objects.
+ *
+ */
+
/*
- * call-seq:
- * DescriptorPool.new => pool
+ * ruby-doc: DescriptorPool.new
*
* Creates a new, empty, descriptor pool.
*/
@@ -112,10 +118,14 @@ static VALUE DescriptorPool_alloc(VALUE klass) {
}
/*
- * call-seq:
- * DescriptorPool.add_serialized_file(serialized_file_proto)
+ * ruby-doc: DescriptorPool#add_serialized_file
+ *
+ * Adds the given serialized
+ * {https://protobuf.com/docs/descriptors#file-descriptors FileDescriptorProto}
+ * to the pool.
*
- * Adds the given serialized FileDescriptorProto to the pool.
+ * @param serialized_file_proto [String]
+ * @return [FileDescriptor]
*/
VALUE DescriptorPool_add_serialized_file(VALUE _self,
VALUE serialized_file_proto) {
@@ -143,11 +153,14 @@ VALUE DescriptorPool_add_serialized_file(VALUE _self,
}
/*
- * call-seq:
- * DescriptorPool.lookup(name) => descriptor
+ * ruby-doc: DescriptorPool#lookup
*
- * Finds a Descriptor, EnumDescriptor, FieldDescriptor or ServiceDescriptor by
+ * Finds a {Descriptor}, {EnumDescriptor},
+ * {FieldDescriptor} or {ServiceDescriptor} by
* name and returns it, or nil if none exists with the given name.
+ *
+ * @param name [String]
+ * @return [Descriptor,EnumDescriptor,FieldDescriptor,ServiceDescriptor]
*/
static VALUE DescriptorPool_lookup(VALUE _self, VALUE name) {
DescriptorPool* self = ruby_to_DescriptorPool(_self);
@@ -187,13 +200,14 @@ static VALUE DescriptorPool_lookup(VALUE _self, VALUE name) {
}
/*
- * call-seq:
- * DescriptorPool.generated_pool => descriptor_pool
+ * ruby-doc: DescriptorPool.generated_pool
*
- * Class method that returns the global DescriptorPool. This is a singleton into
- * which generated-code message and enum types are registered. The user may also
- * register types in this pool for convenience so that they do not have to hold
- * a reference to a private pool instance.
+ * Class method that returns the global {DescriptorPool}. This is a singleton
+ * into which generated-code message and enum types are registered. The user may
+ * also register types in this pool for convenience so that they do not have to
+ * hold a reference to a private pool instance.
+ *
+ * @return [DescriptorPool]
*/
static VALUE DescriptorPool_generated_pool(VALUE _self) {
return generated_pool;
@@ -290,8 +304,13 @@ static VALUE decode_options(VALUE self, const char* option_type, int size,
}
/*
- * call-seq:
- * Descriptor.new => descriptor
+ * ruby-doc: Descriptor
+ *
+ * A Descriptor provides information about a given Protobuf definition.
+ */
+
+/*
+ * ruby-doc: Descriptor.initialize
*
* Creates a new, empty, message type descriptor. At a minimum, its name must be
* set before it is added to a pool. It cannot be used to create messages until
@@ -329,10 +348,11 @@ static VALUE Descriptor_initialize(VALUE _self, VALUE cookie,
}
/*
- * call-seq:
- * Descriptor.file_descriptor
+ * ruby-doc: Descriptor#file_descriptor
*
- * Returns the FileDescriptor object this message belongs to.
+ * Returns the {FileDescriptor} object this message belongs to.
+ *
+ * @return [FileDescriptor]
*/
static VALUE Descriptor_file_descriptor(VALUE _self) {
Descriptor* self = ruby_to_Descriptor(_self);
@@ -341,11 +361,12 @@ static VALUE Descriptor_file_descriptor(VALUE _self) {
}
/*
- * call-seq:
- * Descriptor.name => name
+ * ruby-doc: Descriptor#name
*
* Returns the name of this message type as a fully-qualified string (e.g.,
* My.Package.MessageType).
+ *
+ * @return [String]
*/
static VALUE Descriptor_name(VALUE _self) {
Descriptor* self = ruby_to_Descriptor(_self);
@@ -353,10 +374,12 @@ static VALUE Descriptor_name(VALUE _self) {
}
/*
- * call-seq:
- * Descriptor.each(&block)
+ * ruby-doc: Descriptor#each
*
* Iterates over fields in this message type, yielding to the block on each one.
+ *
+ * @yield [FieldDescriptor]
+ * @return [nil]
*/
static VALUE Descriptor_each(VALUE _self) {
Descriptor* self = ruby_to_Descriptor(_self);
@@ -371,11 +394,13 @@ static VALUE Descriptor_each(VALUE _self) {
}
/*
- * call-seq:
- * Descriptor.lookup(name) => FieldDescriptor
+ * ruby-doc: Descriptor#lookup
*
* Returns the field descriptor for the field with the given name, if present,
* or nil if none.
+ *
+ * @param name [String]
+ * @return [FieldDescriptor]
*/
static VALUE Descriptor_lookup(VALUE _self, VALUE name) {
Descriptor* self = ruby_to_Descriptor(_self);
@@ -388,11 +413,13 @@ static VALUE Descriptor_lookup(VALUE _self, VALUE name) {
}
/*
- * call-seq:
- * Descriptor.each_oneof(&block) => nil
+ * ruby-doc: Descriptor#each_oneof
*
* Invokes the given block for each oneof in this message type, passing the
- * corresponding OneofDescriptor.
+ * corresponding {OneofDescriptor}.
+ *
+ * @yield [OneofDescriptor]
+ * @return [nil]
*/
static VALUE Descriptor_each_oneof(VALUE _self) {
Descriptor* self = ruby_to_Descriptor(_self);
@@ -407,11 +434,13 @@ static VALUE Descriptor_each_oneof(VALUE _self) {
}
/*
- * call-seq:
- * Descriptor.lookup_oneof(name) => OneofDescriptor
+ * ruby-doc: Descriptor#lookup_oneof
*
* Returns the oneof descriptor for the oneof with the given name, if present,
* or nil if none.
+ *
+ * @param name [String]
+ * @return [OneofDescriptor]
*/
static VALUE Descriptor_lookup_oneof(VALUE _self, VALUE name) {
Descriptor* self = ruby_to_Descriptor(_self);
@@ -424,10 +453,11 @@ static VALUE Descriptor_lookup_oneof(VALUE _self, VALUE name) {
}
/*
- * call-seq:
- * Descriptor.msgclass => message_klass
+ * ruby-doc: Descriptor#msgclass
*
* Returns the Ruby class created for this message type.
+ *
+ * @return [Class]
*/
static VALUE Descriptor_msgclass(VALUE _self) {
Descriptor* self = ruby_to_Descriptor(_self);
@@ -438,10 +468,13 @@ static VALUE Descriptor_msgclass(VALUE _self) {
}
/*
- * call-seq:
- * Descriptor.options => options
+ * ruby-doc: Descriptor#options
*
- * Returns the `MessageOptions` for this `Descriptor`.
+ * Returns the
+ * {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L571
+ * MessageOptions} for this {Descriptor}.
+ *
+ * @return [MessageOptions]
*/
static VALUE Descriptor_options(VALUE _self) {
Descriptor* self = ruby_to_Descriptor(_self);
@@ -458,10 +491,13 @@ static VALUE Descriptor_options(VALUE _self) {
}
/*
- * call-seq:
- * Descriptor.to_proto => DescriptorProto
+ * ruby-doc: Descriptor#to_proto
*
- * Returns the `DescriptorProto` of this `Descriptor`.
+ * Returns the
+ * {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L147
+ * DescriptorProto} of this {Descriptor}.
+ *
+ * @return [DescriptorProto]
*/
static VALUE Descriptor_to_proto(VALUE _self) {
Descriptor* self = ruby_to_Descriptor(_self);
@@ -534,9 +570,15 @@ static VALUE FileDescriptor_alloc(VALUE klass) {
return ret;
}
+/**
+ * ruby-doc: FileDescriptor
+ *
+ * A FileDescriptor provides information about all Protobuf definitions in a
+ * particular file.
+ */
+
/*
- * call-seq:
- * FileDescriptor.new => file
+ * ruby-doc: FileDescriptor#initialize
*
* Returns a new file descriptor. May
* to a builder.
@@ -557,10 +599,11 @@ static VALUE FileDescriptor_initialize(VALUE _self, VALUE cookie,
}
/*
- * call-seq:
- * FileDescriptor.name => name
+ * ruby-doc: FileDescriptor#name
*
* Returns the name of the file.
+ *
+ * @return [String]
*/
static VALUE FileDescriptor_name(VALUE _self) {
FileDescriptor* self = ruby_to_FileDescriptor(_self);
@@ -569,10 +612,13 @@ static VALUE FileDescriptor_name(VALUE _self) {
}
/*
- * call-seq:
- * FileDescriptor.options => options
+ * ruby-doc: FileDescriptor#options
+ *
+ * Returns the
+ * {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L442
+ * FileOptions} for this {FileDescriptor}.
*
- * Returns the `FileOptions` for this `FileDescriptor`.
+ * @return [FileOptions]
*/
static VALUE FileDescriptor_options(VALUE _self) {
FileDescriptor* self = ruby_to_FileDescriptor(_self);
@@ -587,10 +633,13 @@ static VALUE FileDescriptor_options(VALUE _self) {
}
/*
- * call-seq:
- * FileDescriptor.to_proto => FileDescriptorProto
+ * ruby-doc: FileDescriptor#to_proto
+ *
+ * Returns the
+ * {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L104
+ * FileDescriptorProto} of this {FileDescriptor}.
*
- * Returns the `FileDescriptorProto` of this `FileDescriptor`.
+ * @return [FileDescriptorProto]
*/
static VALUE FileDescriptor_to_proto(VALUE _self) {
FileDescriptor* self = ruby_to_FileDescriptor(_self);
@@ -651,9 +700,15 @@ static FieldDescriptor* ruby_to_FieldDescriptor(VALUE val) {
return ret;
}
+/**
+ * ruby-doc: FieldDescriptor
+ *
+ * A FieldDescriptor provides information about the Protobuf definition of a
+ * field inside a {Descriptor}.
+ */
+
/*
- * call-seq:
- * FieldDescriptor.new => field
+ * ruby-doc: FieldDescriptor#initialize
*
* Returns a new field descriptor. Its name, type, etc. must be set before it is
* added to a message type.
@@ -687,10 +742,11 @@ static VALUE FieldDescriptor_initialize(VALUE _self, VALUE cookie,
}
/*
- * call-seq:
- * FieldDescriptor.name => name
+ * ruby-doc: FieldDescriptor#name
*
* Returns the name of this field.
+ *
+ * @return [String]
*/
static VALUE FieldDescriptor_name(VALUE _self) {
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -755,14 +811,15 @@ static VALUE descriptortype_to_ruby(upb_FieldType type) {
}
/*
- * call-seq:
- * FieldDescriptor.type => type
+ * ruby-doc: FieldDescriptor#type
*
* Returns this field's type, as a Ruby symbol, or nil if not yet set.
*
* Valid field types are:
* :int32, :int64, :uint32, :uint64, :float, :double, :bool, :string,
* :bytes, :message.
+ *
+ * @return [Symbol]
*/
static VALUE FieldDescriptor__type(VALUE _self) {
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -770,10 +827,11 @@ static VALUE FieldDescriptor__type(VALUE _self) {
}
/*
- * call-seq:
- * FieldDescriptor.default => default
+ * ruby-doc: FieldDescriptor#default
*
* Returns this field's default, as a Ruby object, or nil if not yet set.
+ *
+ * @return [Object,nil]
*/
static VALUE FieldDescriptor_default(VALUE _self) {
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -788,10 +846,11 @@ static VALUE FieldDescriptor_default(VALUE _self) {
}
/*
- * call-seq:
- * FieldDescriptor.has_presence? => bool
+ * ruby-doc: FieldDescriptor.has_presence?
*
* Returns whether this field tracks presence.
+ *
+ * @return [Boolean]
*/
static VALUE FieldDescriptor_has_presence(VALUE _self) {
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -799,10 +858,11 @@ static VALUE FieldDescriptor_has_presence(VALUE _self) {
}
/*
- * call-seq:
- * FieldDescriptor.required? => bool
+ * ruby-doc: FieldDescriptor#required?
*
* Returns whether this is a required field.
+ *
+ * @return [Boolean]
*/
static VALUE FieldDescriptor_is_required(VALUE _self) {
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -810,10 +870,10 @@ static VALUE FieldDescriptor_is_required(VALUE _self) {
}
/*
- * call-seq:
- * FieldDescriptor.repeated? => bool
+ * ruby-doc: FieldDescriptor#repeated?
*
* Returns whether this is a repeated field.
+ * @return [Boolean]
*/
static VALUE FieldDescriptor_is_repeated(VALUE _self) {
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -821,10 +881,10 @@ static VALUE FieldDescriptor_is_repeated(VALUE _self) {
}
/*
- * call-seq:
- * FieldDescriptor.is_packed? => bool
+ * ruby-doc: FieldDescriptor#is_packed?
*
* Returns whether this is a repeated field that uses packed encoding.
+ * @return [Boolean]
*/
static VALUE FieldDescriptor_is_packed(VALUE _self) {
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -832,10 +892,11 @@ static VALUE FieldDescriptor_is_packed(VALUE _self) {
}
/*
- * call-seq:
- * FieldDescriptor.json_name => json_name
+ * ruby-doc: FieldDescriptor#json_name
*
* Returns this field's json_name, as a Ruby string, or nil if not yet set.
+ *
+ * @return [String,nil]
*/
static VALUE FieldDescriptor_json_name(VALUE _self) {
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -845,15 +906,14 @@ static VALUE FieldDescriptor_json_name(VALUE _self) {
}
/*
- * DEPRECATED: Use repeated? or required? instead.
- *
- * call-seq:
- * FieldDescriptor.label => label
+ * ruby-doc: FieldDescriptor#label
*
* Returns this field's label (i.e., plurality), as a Ruby symbol.
- *
* Valid field labels are:
- * :optional, :repeated
+ * :optional, :repeated
+ *
+ * @return [Symbol]
+ * @deprecated Use {#repeated?} or {#required?} instead.
*/
static VALUE FieldDescriptor_label(VALUE _self) {
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -873,10 +933,11 @@ static VALUE FieldDescriptor_label(VALUE _self) {
}
/*
- * call-seq:
- * FieldDescriptor.number => number
+ * ruby-doc: FieldDescriptor#number
*
* Returns the tag number for this field.
+ *
+ * @return [Integer]
*/
static VALUE FieldDescriptor_number(VALUE _self) {
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -884,13 +945,14 @@ static VALUE FieldDescriptor_number(VALUE _self) {
}
/*
- * call-seq:
- * FieldDescriptor.submsg_name => submsg_name
+ * ruby-doc: FieldDescriptor#submsg_name
*
* Returns the name of the message or enum type corresponding to this field, if
* it is a message or enum field (respectively), or nil otherwise. This type
* name will be resolved within the context of the pool to which the containing
* message type is added.
+ *
+ * @return [String,nil]
*/
static VALUE FieldDescriptor_submsg_name(VALUE _self) {
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -907,13 +969,14 @@ static VALUE FieldDescriptor_submsg_name(VALUE _self) {
}
/*
- * call-seq:
- * FieldDescriptor.subtype => message_or_enum_descriptor
+ * ruby-doc: FieldDescriptor#subtype
*
* Returns the message or enum descriptor corresponding to this field's type if
* it is a message or enum field, respectively, or nil otherwise. Cannot be
* called *until* the containing message type is added to a pool (and thus
* resolved).
+ *
+ * @return [Descriptor,EnumDescriptor,nil]
*/
static VALUE FieldDescriptor_subtype(VALUE _self) {
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -930,11 +993,13 @@ static VALUE FieldDescriptor_subtype(VALUE _self) {
}
/*
- * call-seq:
- * FieldDescriptor.get(message) => value
+ * ruby-doc: FieldDescriptor#get
*
* Returns the value set for this field on the given message. Raises an
* exception if message is of the wrong type.
+ *
+ * @param message [AbstractMessage]
+ * @return [Object]
*/
static VALUE FieldDescriptor_get(VALUE _self, VALUE msg_rb) {
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -950,11 +1015,13 @@ static VALUE FieldDescriptor_get(VALUE _self, VALUE msg_rb) {
}
/*
- * call-seq:
- * FieldDescriptor.has?(message) => boolean
+ * ruby-doc: FieldDescriptor.has?
*
* Returns whether the value is set on the given message. Raises an
* exception when calling for fields that do not have presence.
+ *
+ * @param message [AbstractMessage]
+ * @return [Boolean]
*/
static VALUE FieldDescriptor_has(VALUE _self, VALUE msg_rb) {
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -971,10 +1038,12 @@ static VALUE FieldDescriptor_has(VALUE _self, VALUE msg_rb) {
}
/*
- * call-seq:
- * FieldDescriptor.clear(message)
+ * ruby-doc: FieldDescriptor#clear
*
* Clears the field from the message if it's set.
+ *
+ * @param message [AbstractMessage]
+ * @return [nil]
*/
static VALUE FieldDescriptor_clear(VALUE _self, VALUE msg_rb) {
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -990,12 +1059,14 @@ static VALUE FieldDescriptor_clear(VALUE _self, VALUE msg_rb) {
}
/*
- * call-seq:
- * FieldDescriptor.set(message, value)
+ * ruby-doc: FieldDescriptor#set
*
* Sets the value corresponding to this field to the given value on the given
* message. Raises an exception if message is of the wrong type. Performs the
* ordinary type-checks for field setting.
+ *
+ * @param message [AbstractMessage]
+ * @param value [Object]
*/
static VALUE FieldDescriptor_set(VALUE _self, VALUE msg_rb, VALUE value) {
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -1015,10 +1086,13 @@ static VALUE FieldDescriptor_set(VALUE _self, VALUE msg_rb, VALUE value) {
}
/*
- * call-seq:
- * FieldDescriptor.options => options
+ * ruby-doc: FieldDescriptor#options
+ *
+ * Returns the
+ * {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L656
+ * FieldOptions} for this {FieldDescriptor}.
*
- * Returns the `FieldOptions` for this `FieldDescriptor`.
+ * @return [FieldOptions]
*/
static VALUE FieldDescriptor_options(VALUE _self) {
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -1034,10 +1108,13 @@ static VALUE FieldDescriptor_options(VALUE _self) {
}
/*
- * call-seq:
- * FieldDescriptor.to_proto => FieldDescriptorProto
+ * ruby-doc: FieldDescriptor#to_proto
+ *
+ * Returns the
+ * {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L236
+ * FieldDescriptorProto} of this {FieldDescriptor}.
*
- * Returns the `FieldDescriptorProto` of this `FieldDescriptor`.
+ * @return [FieldDescriptorProto]
*/
static VALUE FieldDescriptor_to_proto(VALUE _self) {
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -1110,9 +1187,15 @@ static OneofDescriptor* ruby_to_OneofDescriptor(VALUE val) {
return ret;
}
+/**
+ * ruby-doc: OneofDescriptor
+ *
+ * A OneofDescriptor provides information about the Protobuf definition of a
+ * oneof inside a {Descriptor}.
+ */
+
/*
- * call-seq:
- * OneofDescriptor.new => oneof_descriptor
+ * ruby-doc: OneofDescriptor#initialize
*
* Creates a new, empty, oneof descriptor. The oneof may only be modified prior
* to being added to a message descriptor which is subsequently added to a pool.
@@ -1147,10 +1230,11 @@ static VALUE OneofDescriptor_initialize(VALUE _self, VALUE cookie,
}
/*
- * call-seq:
- * OneofDescriptor.name => name
+ * ruby-doc: OneofDescriptor#name
*
* Returns the name of this oneof.
+ *
+ * @return [String]
*/
static VALUE OneofDescriptor_name(VALUE _self) {
OneofDescriptor* self = ruby_to_OneofDescriptor(_self);
@@ -1158,10 +1242,12 @@ static VALUE OneofDescriptor_name(VALUE _self) {
}
/*
- * call-seq:
- * OneofDescriptor.each(&block) => nil
+ * ruby-doc: OneofDescriptor#each
*
* Iterates through fields in this oneof, yielding to the block on each one.
+ *
+ * @yield [FieldDescriptor]
+ * @return [nil]
*/
static VALUE OneofDescriptor_each(VALUE _self) {
OneofDescriptor* self = ruby_to_OneofDescriptor(_self);
@@ -1176,10 +1262,13 @@ static VALUE OneofDescriptor_each(VALUE _self) {
}
/*
- * call-seq:
- * OneofDescriptor.options => options
+ * ruby-doc: OneofDescriptor#options
+ *
+ * Returns the
+ * {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L824
+ * OneofOptions} for this {OneofDescriptor}.
*
- * Returns the `OneofOptions` for this `OneofDescriptor`.
+ * @return [OneofOptions]
*/
static VALUE OneOfDescriptor_options(VALUE _self) {
OneofDescriptor* self = ruby_to_OneofDescriptor(_self);
@@ -1195,10 +1284,13 @@ static VALUE OneOfDescriptor_options(VALUE _self) {
}
/*
- * call-seq:
- * OneofDescriptor.to_proto => OneofDescriptorProto
+ * ruby-doc: OneofDescriptor#to_proto
+ *
+ * Returns the
+ * {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L343
+ * OneofDescriptorProto} of this {OneofDescriptor}.
*
- * Returns the `OneofDescriptorProto` of this `OneofDescriptor`.
+ * @return [OneofDescriptorProto]
*/
static VALUE OneOfDescriptor_to_proto(VALUE _self) {
OneofDescriptor* self = ruby_to_OneofDescriptor(_self);
@@ -1275,6 +1367,13 @@ const upb_EnumDef* EnumDescriptor_GetEnumDef(VALUE enum_desc_rb) {
return desc->enumdef;
}
+/**
+ * ruby-doc: EnumDescriptor
+ *
+ * An EnumDescriptor provides information about the Protobuf definition of an
+ * enum inside a {Descriptor}.
+ */
+
/*
* call-seq:
* EnumDescriptor.new(c_only_cookie, ptr) => EnumDescriptor
@@ -1297,10 +1396,11 @@ static VALUE EnumDescriptor_initialize(VALUE _self, VALUE cookie,
}
/*
- * call-seq:
- * EnumDescriptor.file_descriptor
+ * ruby-doc: EnumDescriptor#file_descriptor
*
- * Returns the FileDescriptor object this enum belongs to.
+ * Returns the {FileDescriptor} object this enum belongs to.
+ *
+ * @return [FileDescriptor]
*/
static VALUE EnumDescriptor_file_descriptor(VALUE _self) {
EnumDescriptor* self = ruby_to_EnumDescriptor(_self);
@@ -1309,10 +1409,11 @@ static VALUE EnumDescriptor_file_descriptor(VALUE _self) {
}
/*
- * call-seq:
- * EnumDescriptor.is_closed? => bool
+ * ruby-doc: EnumDescriptor#is_closed?
*
* Returns whether this enum is open or closed.
+ *
+ * @return [Boolean]
*/
static VALUE EnumDescriptor_is_closed(VALUE _self) {
EnumDescriptor* self = ruby_to_EnumDescriptor(_self);
@@ -1320,10 +1421,11 @@ static VALUE EnumDescriptor_is_closed(VALUE _self) {
}
/*
- * call-seq:
- * EnumDescriptor.name => name
+ * ruby-doc: EnumDescriptor#name
*
* Returns the name of this enum type.
+ *
+ * @return [String]
*/
static VALUE EnumDescriptor_name(VALUE _self) {
EnumDescriptor* self = ruby_to_EnumDescriptor(_self);
@@ -1331,11 +1433,13 @@ static VALUE EnumDescriptor_name(VALUE _self) {
}
/*
- * call-seq:
- * EnumDescriptor.lookup_name(name) => value
+ * ruby-doc: EnumDescriptor#lookup_name
*
* Returns the numeric value corresponding to the given key name (as a Ruby
* symbol), or nil if none.
+ *
+ * @param name [Symbol]
+ * @return [Integer,nil]
*/
static VALUE EnumDescriptor_lookup_name(VALUE _self, VALUE name) {
EnumDescriptor* self = ruby_to_EnumDescriptor(_self);
@@ -1350,11 +1454,13 @@ static VALUE EnumDescriptor_lookup_name(VALUE _self, VALUE name) {
}
/*
- * call-seq:
- * EnumDescriptor.lookup_value(name) => value
+ * ruby-doc: EnumDescriptor#lookup_value
*
* Returns the key name (as a Ruby symbol) corresponding to the integer value,
* or nil if none.
+ *
+ * @param name [Integer]
+ * @return [Symbol,nil]
*/
static VALUE EnumDescriptor_lookup_value(VALUE _self, VALUE number) {
EnumDescriptor* self = ruby_to_EnumDescriptor(_self);
@@ -1369,11 +1475,13 @@ static VALUE EnumDescriptor_lookup_value(VALUE _self, VALUE number) {
}
/*
- * call-seq:
- * EnumDescriptor.each(&block)
+ * ruby-doc: EnumDescriptor#each
*
* Iterates over key => value mappings in this enum's definition, yielding to
* the block with (key, value) arguments for each one.
+ *
+ * @yield [Symbol, Integer]
+ * @return [nil]
*/
static VALUE EnumDescriptor_each(VALUE _self) {
EnumDescriptor* self = ruby_to_EnumDescriptor(_self);
@@ -1390,10 +1498,11 @@ static VALUE EnumDescriptor_each(VALUE _self) {
}
/*
- * call-seq:
- * EnumDescriptor.enummodule => module
+ * ruby-doc: EnumDescriptor#enummodule
*
* Returns the Ruby module corresponding to this enum type.
+ *
+ * @return [Module]
*/
static VALUE EnumDescriptor_enummodule(VALUE _self) {
EnumDescriptor* self = ruby_to_EnumDescriptor(_self);
@@ -1404,10 +1513,13 @@ static VALUE EnumDescriptor_enummodule(VALUE _self) {
}
/*
- * call-seq:
- * EnumDescriptor.options => options
+ * ruby-doc: EnumDescriptor#options
*
- * Returns the `EnumOptions` for this `EnumDescriptor`.
+ * Returns the
+ * {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L838
+ * EnumOptions} for this {EnumDescriptor}.
+ *
+ * @return [EnumOptions]
*/
static VALUE EnumDescriptor_options(VALUE _self) {
EnumDescriptor* self = ruby_to_EnumDescriptor(_self);
@@ -1422,10 +1534,12 @@ static VALUE EnumDescriptor_options(VALUE _self) {
}
/*
- * call-seq:
- * EnumDescriptor.to_proto => EnumDescriptorProto
+ * ruby-doc: EnumDescriptor#to_proto
*
- * Returns the `EnumDescriptorProto` of this `EnumDescriptor`.
+ * Returns the
+ * {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L349
+ * EnumDescriptorProto} of this {EnumDescriptor}.
+ * @return [EnumDescriptorProto]
*/
static VALUE EnumDescriptor_to_proto(VALUE _self) {
EnumDescriptor* self = ruby_to_EnumDescriptor(_self);
@@ -1503,6 +1617,13 @@ static VALUE ServiceDescriptor_alloc(VALUE klass) {
return ret;
}
+/**
+ * ruby-doc: ServiceDescriptor
+ *
+ * A ServiceDescriptor provides information about the Protobuf definition of an
+ * RPC service.
+ */
+
/*
* call-seq:
* ServiceDescriptor.new(c_only_cookie, ptr) => ServiceDescriptor
@@ -1525,10 +1646,11 @@ static VALUE ServiceDescriptor_initialize(VALUE _self, VALUE cookie,
}
/*
- * call-seq:
- * ServiceDescriptor.name => name
+ * ruby-doc: ServiceDescriptor#name
*
* Returns the name of this service.
+ *
+ * @return [String]
*/
static VALUE ServiceDescriptor_name(VALUE _self) {
ServiceDescriptor* self = ruby_to_ServiceDescriptor(_self);
@@ -1536,10 +1658,10 @@ static VALUE ServiceDescriptor_name(VALUE _self) {
}
/*
- * call-seq:
- * ServiceDescriptor.file_descriptor
+ * ruby-doc: ServiceDescriptor#file_descriptor
*
- * Returns the FileDescriptor object this service belongs to.
+ * Returns the {FileDescriptor} object this service belongs to.
+ * @return [FileDescriptor]
*/
static VALUE ServiceDescriptor_file_descriptor(VALUE _self) {
ServiceDescriptor* self = ruby_to_ServiceDescriptor(_self);
@@ -1548,10 +1670,12 @@ static VALUE ServiceDescriptor_file_descriptor(VALUE _self) {
}
/*
- * call-seq:
- * ServiceDescriptor.each(&block)
+ * ruby-doc: ServiceDescriptor#each
*
* Iterates over methods in this service, yielding to the block on each one.
+ *
+ * @yield [MethodDescriptor]
+ * @return [nil]
*/
static VALUE ServiceDescriptor_each(VALUE _self) {
ServiceDescriptor* self = ruby_to_ServiceDescriptor(_self);
@@ -1566,10 +1690,13 @@ static VALUE ServiceDescriptor_each(VALUE _self) {
}
/*
- * call-seq:
- * ServiceDescriptor.options => options
+ * ruby-doc: ServiceDescriptor#options
*
- * Returns the `ServiceOptions` for this `ServiceDescriptor`.
+ * Returns the
+ * {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L901
+ * ServiceOptions} for this {ServiceDescriptor}.
+ *
+ * @return [ServiceOptions]
*/
static VALUE ServiceDescriptor_options(VALUE _self) {
ServiceDescriptor* self = ruby_to_ServiceDescriptor(_self);
@@ -1586,10 +1713,13 @@ static VALUE ServiceDescriptor_options(VALUE _self) {
}
/*
- * call-seq:
- * ServiceDescriptor.to_proto => ServiceDescriptorProto
+ * ruby-doc: ServiceDescriptor#to_proto
*
- * Returns the `ServiceDescriptorProto` of this `ServiceDescriptor`.
+ * Returns the
+ * {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L386
+ * ServiceDescriptorProto} of this {ServiceDescriptor}.
+ *
+ * @return [ServiceDescriptorProto]
*/
static VALUE ServiceDescriptor_to_proto(VALUE _self) {
ServiceDescriptor* self = ruby_to_ServiceDescriptor(_self);
@@ -1662,6 +1792,13 @@ static VALUE MethodDescriptor_alloc(VALUE klass) {
return ret;
}
+/**
+ * ruby-doc: MethodDescriptor
+ *
+ * A MethodDescriptor provides information about the Protobuf definition of a
+ * method inside an RPC service.
+ */
+
/*
* call-seq:
* MethodDescriptor.new(c_only_cookie, ptr) => MethodDescriptor
@@ -1684,10 +1821,11 @@ static VALUE MethodDescriptor_initialize(VALUE _self, VALUE cookie,
}
/*
- * call-seq:
- * MethodDescriptor.name => name
+ * ruby-doc: MethodDescriptor#name
*
* Returns the name of this method
+ *
+ * @return [String]
*/
static VALUE MethodDescriptor_name(VALUE _self) {
MethodDescriptor* self = ruby_to_MethodDescriptor(_self);
@@ -1695,10 +1833,13 @@ static VALUE MethodDescriptor_name(VALUE _self) {
}
/*
- * call-seq:
- * MethodDescriptor.options => options
+ * ruby-doc: MethodDescriptor#options
*
- * Returns the `MethodOptions` for this `MethodDescriptor`.
+ * Returns the
+ * {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L927
+ * MethodOptions} for this {MethodDescriptor}.
+ *
+ * @return [MethodOptions]
*/
static VALUE MethodDescriptor_options(VALUE _self) {
MethodDescriptor* self = ruby_to_MethodDescriptor(_self);
@@ -1715,10 +1856,11 @@ static VALUE MethodDescriptor_options(VALUE _self) {
}
/*
- * call-seq:
- * MethodDescriptor.input_type => Descriptor
+ * ruby-doc: MethodDescriptor#input_type
*
- * Returns the `Descriptor` for the request message type of this method
+ * Returns the {Descriptor} for the request message type of this method
+ *
+ * @return [Descriptor]
*/
static VALUE MethodDescriptor_input_type(VALUE _self) {
MethodDescriptor* self = ruby_to_MethodDescriptor(_self);
@@ -1727,10 +1869,11 @@ static VALUE MethodDescriptor_input_type(VALUE _self) {
}
/*
- * call-seq:
- * MethodDescriptor.output_type => Descriptor
+ * ruby-doc: MethodDescriptor#output_type
+ *
+ * Returns the {Descriptor} for the response message type of this method
*
- * Returns the `Descriptor` for the response message type of this method
+ * @return [Descriptor]
*/
static VALUE MethodDescriptor_output_type(VALUE _self) {
MethodDescriptor* self = ruby_to_MethodDescriptor(_self);
@@ -1739,10 +1882,11 @@ static VALUE MethodDescriptor_output_type(VALUE _self) {
}
/*
- * call-seq:
- * MethodDescriptor.client_streaming => bool
+ * ruby-doc: MethodDescriptor#client_streaming
*
* Returns whether or not this is a streaming request method
+ *
+ * @return [Boolean]
*/
static VALUE MethodDescriptor_client_streaming(VALUE _self) {
MethodDescriptor* self = ruby_to_MethodDescriptor(_self);
@@ -1750,10 +1894,13 @@ static VALUE MethodDescriptor_client_streaming(VALUE _self) {
}
/*
- * call-seq:
- * MethodDescriptor.to_proto => MethodDescriptorProto
+ * ruby-doc: MethodDescriptor#to_proto
+ *
+ * Returns the
+ * {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L394
+ * MethodDescriptorProto} of this {MethodDescriptor}.
*
- * Returns the `MethodDescriptorProto` of this `MethodDescriptor`.
+ * @return [MethodDescriptorProto]
*/
static VALUE MethodDescriptor_to_proto(VALUE _self) {
MethodDescriptor* self = ruby_to_MethodDescriptor(_self);
@@ -1771,10 +1918,11 @@ static VALUE MethodDescriptor_to_proto(VALUE _self) {
}
/*
- * call-seq:
- * MethodDescriptor.server_streaming => bool
+ * ruby-doc: MethodDescriptor#server_streaming
*
* Returns whether or not this is a streaming response method
+ *
+ * @return [Boolean]
*/
static VALUE MethodDescriptor_server_streaming(VALUE _self) {
MethodDescriptor* self = ruby_to_MethodDescriptor(_self);
diff --git a/ruby/ext/google/protobuf_c/map.c b/ruby/ext/google/protobuf_c/map.c
index af4a742622e18..4ad399569a713 100644
--- a/ruby/ext/google/protobuf_c/map.c
+++ b/ruby/ext/google/protobuf_c/map.c
@@ -236,10 +236,15 @@ static VALUE Map_merge_into_self(VALUE _self, VALUE hashmap) {
return _self;
}
+/**
+ * ruby-doc: Map
+ *
+ * This class represents a Protobuf Map. It is largely automatically transformed
+ * to and from a Ruby hash.
+ */
+
/*
- * call-seq:
- * Map.new(key_type, value_type, value_typeclass = nil, init_hashmap = {})
- * => new map
+ * ruby-doc: Map#initialize
*
* Allocates a new Map container. This constructor may be called with 2, 3, or 4
* arguments. The first two arguments are always present and are symbols (taking
@@ -265,6 +270,13 @@ static VALUE Map_merge_into_self(VALUE _self, VALUE hashmap) {
* shallow-copied into the new Map: the original map is unmodified, but
* references to underlying objects will be shared if the value type is a
* message type.
+ *
+ * @param key_type [Symbol]
+ * @param value_type [Symbol]
+ * @param value_typeclass [Class,Module]
+ * @paramdefault value_typeclass nil
+ * @param init_hashmap [Hash,Map]
+ * @paramdefault init_hashmap {}
*/
static VALUE Map_init(int argc, VALUE* argv, VALUE _self) {
Map* self = ruby_to_Map(_self);
@@ -311,12 +323,14 @@ static VALUE Map_init(int argc, VALUE* argv, VALUE _self) {
}
/*
- * call-seq:
- * Map.each(&block)
+ * ruby-doc: Map#each
*
* Invokes &block on each |key, value| pair in the map, in unspecified order.
* Note that Map also includes Enumerable; map thus acts like a normal Ruby
* sequence.
+ *
+ * @yield [Object, Object]
+ * @return [nil]
*/
static VALUE Map_each(VALUE _self) {
Map* self = ruby_to_Map(_self);
@@ -333,10 +347,11 @@ static VALUE Map_each(VALUE _self) {
}
/*
- * call-seq:
- * Map.keys => [list_of_keys]
+ * ruby-doc: Map#keys
*
* Returns the list of keys contained in the map, in unspecified order.
+ *
+ * @return [Array