google-protobuf 4.31.0 → 4.35.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -93,9 +93,15 @@ const upb_DefPool* DescriptorPool_GetSymtab(VALUE desc_pool_rb) {
93
93
  return pool->symtab;
94
94
  }
95
95
 
96
+ /**
97
+ * ruby-doc: DescriptorPool
98
+ *
99
+ * A DescriptorPool is the registry of all known Protobuf descriptor objects.
100
+ *
101
+ */
102
+
96
103
  /*
97
- * call-seq:
98
- * DescriptorPool.new => pool
104
+ * ruby-doc: DescriptorPool.new
99
105
  *
100
106
  * Creates a new, empty, descriptor pool.
101
107
  */
@@ -108,14 +114,22 @@ static VALUE DescriptorPool_alloc(VALUE klass) {
108
114
 
109
115
  RB_OBJ_WRITE(ret, &self->def_to_descriptor, rb_hash_new());
110
116
  self->symtab = upb_DefPool_New();
117
+
118
+ // Ruby treats all enums as open.
119
+ upb_DefPool_DisableClosedEnumChecking(self->symtab);
120
+
111
121
  return ObjectCache_TryAdd(self->symtab, ret);
112
122
  }
113
123
 
114
124
  /*
115
- * call-seq:
116
- * DescriptorPool.add_serialized_file(serialized_file_proto)
125
+ * ruby-doc: DescriptorPool#add_serialized_file
117
126
  *
118
- * Adds the given serialized FileDescriptorProto to the pool.
127
+ * Adds the given serialized
128
+ * {https://protobuf.com/docs/descriptors#file-descriptors FileDescriptorProto}
129
+ * to the pool.
130
+ *
131
+ * @param serialized_file_proto [String]
132
+ * @return [FileDescriptor]
119
133
  */
120
134
  VALUE DescriptorPool_add_serialized_file(VALUE _self,
121
135
  VALUE serialized_file_proto) {
@@ -143,11 +157,14 @@ VALUE DescriptorPool_add_serialized_file(VALUE _self,
143
157
  }
144
158
 
145
159
  /*
146
- * call-seq:
147
- * DescriptorPool.lookup(name) => descriptor
160
+ * ruby-doc: DescriptorPool#lookup
148
161
  *
149
- * Finds a Descriptor, EnumDescriptor, FieldDescriptor or ServiceDescriptor by
162
+ * Finds a {Descriptor}, {EnumDescriptor},
163
+ * {FieldDescriptor} or {ServiceDescriptor} by
150
164
  * name and returns it, or nil if none exists with the given name.
165
+ *
166
+ * @param name [String]
167
+ * @return [Descriptor,EnumDescriptor,FieldDescriptor,ServiceDescriptor]
151
168
  */
152
169
  static VALUE DescriptorPool_lookup(VALUE _self, VALUE name) {
153
170
  DescriptorPool* self = ruby_to_DescriptorPool(_self);
@@ -187,13 +204,14 @@ static VALUE DescriptorPool_lookup(VALUE _self, VALUE name) {
187
204
  }
188
205
 
189
206
  /*
190
- * call-seq:
191
- * DescriptorPool.generated_pool => descriptor_pool
207
+ * ruby-doc: DescriptorPool.generated_pool
208
+ *
209
+ * Class method that returns the global {DescriptorPool}. This is a singleton
210
+ * into which generated-code message and enum types are registered. The user may
211
+ * also register types in this pool for convenience so that they do not have to
212
+ * hold a reference to a private pool instance.
192
213
  *
193
- * Class method that returns the global DescriptorPool. This is a singleton into
194
- * which generated-code message and enum types are registered. The user may also
195
- * register types in this pool for convenience so that they do not have to hold
196
- * a reference to a private pool instance.
214
+ * @return [DescriptorPool]
197
215
  */
198
216
  static VALUE DescriptorPool_generated_pool(VALUE _self) {
199
217
  return generated_pool;
@@ -290,8 +308,13 @@ static VALUE decode_options(VALUE self, const char* option_type, int size,
290
308
  }
291
309
 
292
310
  /*
293
- * call-seq:
294
- * Descriptor.new => descriptor
311
+ * ruby-doc: Descriptor
312
+ *
313
+ * A Descriptor provides information about a given Protobuf definition.
314
+ */
315
+
316
+ /*
317
+ * ruby-doc: Descriptor.initialize
295
318
  *
296
319
  * Creates a new, empty, message type descriptor. At a minimum, its name must be
297
320
  * set before it is added to a pool. It cannot be used to create messages until
@@ -329,10 +352,11 @@ static VALUE Descriptor_initialize(VALUE _self, VALUE cookie,
329
352
  }
330
353
 
331
354
  /*
332
- * call-seq:
333
- * Descriptor.file_descriptor
355
+ * ruby-doc: Descriptor#file_descriptor
334
356
  *
335
- * Returns the FileDescriptor object this message belongs to.
357
+ * Returns the {FileDescriptor} object this message belongs to.
358
+ *
359
+ * @return [FileDescriptor]
336
360
  */
337
361
  static VALUE Descriptor_file_descriptor(VALUE _self) {
338
362
  Descriptor* self = ruby_to_Descriptor(_self);
@@ -341,11 +365,12 @@ static VALUE Descriptor_file_descriptor(VALUE _self) {
341
365
  }
342
366
 
343
367
  /*
344
- * call-seq:
345
- * Descriptor.name => name
368
+ * ruby-doc: Descriptor#name
346
369
  *
347
370
  * Returns the name of this message type as a fully-qualified string (e.g.,
348
371
  * My.Package.MessageType).
372
+ *
373
+ * @return [String]
349
374
  */
350
375
  static VALUE Descriptor_name(VALUE _self) {
351
376
  Descriptor* self = ruby_to_Descriptor(_self);
@@ -353,10 +378,12 @@ static VALUE Descriptor_name(VALUE _self) {
353
378
  }
354
379
 
355
380
  /*
356
- * call-seq:
357
- * Descriptor.each(&block)
381
+ * ruby-doc: Descriptor#each
358
382
  *
359
383
  * Iterates over fields in this message type, yielding to the block on each one.
384
+ *
385
+ * @yield [FieldDescriptor]
386
+ * @return [nil]
360
387
  */
361
388
  static VALUE Descriptor_each(VALUE _self) {
362
389
  Descriptor* self = ruby_to_Descriptor(_self);
@@ -371,11 +398,13 @@ static VALUE Descriptor_each(VALUE _self) {
371
398
  }
372
399
 
373
400
  /*
374
- * call-seq:
375
- * Descriptor.lookup(name) => FieldDescriptor
401
+ * ruby-doc: Descriptor#lookup
376
402
  *
377
403
  * Returns the field descriptor for the field with the given name, if present,
378
404
  * or nil if none.
405
+ *
406
+ * @param name [String]
407
+ * @return [FieldDescriptor]
379
408
  */
380
409
  static VALUE Descriptor_lookup(VALUE _self, VALUE name) {
381
410
  Descriptor* self = ruby_to_Descriptor(_self);
@@ -388,11 +417,13 @@ static VALUE Descriptor_lookup(VALUE _self, VALUE name) {
388
417
  }
389
418
 
390
419
  /*
391
- * call-seq:
392
- * Descriptor.each_oneof(&block) => nil
420
+ * ruby-doc: Descriptor#each_oneof
393
421
  *
394
422
  * Invokes the given block for each oneof in this message type, passing the
395
- * corresponding OneofDescriptor.
423
+ * corresponding {OneofDescriptor}.
424
+ *
425
+ * @yield [OneofDescriptor]
426
+ * @return [nil]
396
427
  */
397
428
  static VALUE Descriptor_each_oneof(VALUE _self) {
398
429
  Descriptor* self = ruby_to_Descriptor(_self);
@@ -407,11 +438,13 @@ static VALUE Descriptor_each_oneof(VALUE _self) {
407
438
  }
408
439
 
409
440
  /*
410
- * call-seq:
411
- * Descriptor.lookup_oneof(name) => OneofDescriptor
441
+ * ruby-doc: Descriptor#lookup_oneof
412
442
  *
413
443
  * Returns the oneof descriptor for the oneof with the given name, if present,
414
444
  * or nil if none.
445
+ *
446
+ * @param name [String]
447
+ * @return [OneofDescriptor]
415
448
  */
416
449
  static VALUE Descriptor_lookup_oneof(VALUE _self, VALUE name) {
417
450
  Descriptor* self = ruby_to_Descriptor(_self);
@@ -424,10 +457,11 @@ static VALUE Descriptor_lookup_oneof(VALUE _self, VALUE name) {
424
457
  }
425
458
 
426
459
  /*
427
- * call-seq:
428
- * Descriptor.msgclass => message_klass
460
+ * ruby-doc: Descriptor#msgclass
429
461
  *
430
462
  * Returns the Ruby class created for this message type.
463
+ *
464
+ * @return [Class<Google::Protobuf::AbstractMessage>]
431
465
  */
432
466
  static VALUE Descriptor_msgclass(VALUE _self) {
433
467
  Descriptor* self = ruby_to_Descriptor(_self);
@@ -438,10 +472,13 @@ static VALUE Descriptor_msgclass(VALUE _self) {
438
472
  }
439
473
 
440
474
  /*
441
- * call-seq:
442
- * Descriptor.options => options
475
+ * ruby-doc: Descriptor#options
443
476
  *
444
- * Returns the `MessageOptions` for this `Descriptor`.
477
+ * Returns the
478
+ * {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L571
479
+ * MessageOptions} for this {Descriptor}.
480
+ *
481
+ * @return [MessageOptions]
445
482
  */
446
483
  static VALUE Descriptor_options(VALUE _self) {
447
484
  Descriptor* self = ruby_to_Descriptor(_self);
@@ -458,10 +495,13 @@ static VALUE Descriptor_options(VALUE _self) {
458
495
  }
459
496
 
460
497
  /*
461
- * call-seq:
462
- * Descriptor.to_proto => DescriptorProto
498
+ * ruby-doc: Descriptor#to_proto
463
499
  *
464
- * Returns the `DescriptorProto` of this `Descriptor`.
500
+ * Returns the
501
+ * {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L147
502
+ * DescriptorProto} of this {Descriptor}.
503
+ *
504
+ * @return [DescriptorProto]
465
505
  */
466
506
  static VALUE Descriptor_to_proto(VALUE _self) {
467
507
  Descriptor* self = ruby_to_Descriptor(_self);
@@ -534,9 +574,15 @@ static VALUE FileDescriptor_alloc(VALUE klass) {
534
574
  return ret;
535
575
  }
536
576
 
577
+ /**
578
+ * ruby-doc: FileDescriptor
579
+ *
580
+ * A FileDescriptor provides information about all Protobuf definitions in a
581
+ * particular file.
582
+ */
583
+
537
584
  /*
538
- * call-seq:
539
- * FileDescriptor.new => file
585
+ * ruby-doc: FileDescriptor#initialize
540
586
  *
541
587
  * Returns a new file descriptor. May
542
588
  * to a builder.
@@ -557,10 +603,11 @@ static VALUE FileDescriptor_initialize(VALUE _self, VALUE cookie,
557
603
  }
558
604
 
559
605
  /*
560
- * call-seq:
561
- * FileDescriptor.name => name
606
+ * ruby-doc: FileDescriptor#name
562
607
  *
563
608
  * Returns the name of the file.
609
+ *
610
+ * @return [String]
564
611
  */
565
612
  static VALUE FileDescriptor_name(VALUE _self) {
566
613
  FileDescriptor* self = ruby_to_FileDescriptor(_self);
@@ -569,10 +616,13 @@ static VALUE FileDescriptor_name(VALUE _self) {
569
616
  }
570
617
 
571
618
  /*
572
- * call-seq:
573
- * FileDescriptor.options => options
619
+ * ruby-doc: FileDescriptor#options
620
+ *
621
+ * Returns the
622
+ * {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L442
623
+ * FileOptions} for this {FileDescriptor}.
574
624
  *
575
- * Returns the `FileOptions` for this `FileDescriptor`.
625
+ * @return [FileOptions]
576
626
  */
577
627
  static VALUE FileDescriptor_options(VALUE _self) {
578
628
  FileDescriptor* self = ruby_to_FileDescriptor(_self);
@@ -587,10 +637,13 @@ static VALUE FileDescriptor_options(VALUE _self) {
587
637
  }
588
638
 
589
639
  /*
590
- * call-seq:
591
- * FileDescriptor.to_proto => FileDescriptorProto
640
+ * ruby-doc: FileDescriptor#to_proto
592
641
  *
593
- * Returns the `FileDescriptorProto` of this `FileDescriptor`.
642
+ * Returns the
643
+ * {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L104
644
+ * FileDescriptorProto} of this {FileDescriptor}.
645
+ *
646
+ * @return [FileDescriptorProto]
594
647
  */
595
648
  static VALUE FileDescriptor_to_proto(VALUE _self) {
596
649
  FileDescriptor* self = ruby_to_FileDescriptor(_self);
@@ -651,9 +704,15 @@ static FieldDescriptor* ruby_to_FieldDescriptor(VALUE val) {
651
704
  return ret;
652
705
  }
653
706
 
707
+ /**
708
+ * ruby-doc: FieldDescriptor
709
+ *
710
+ * A FieldDescriptor provides information about the Protobuf definition of a
711
+ * field inside a {Descriptor}.
712
+ */
713
+
654
714
  /*
655
- * call-seq:
656
- * FieldDescriptor.new => field
715
+ * ruby-doc: FieldDescriptor#initialize
657
716
  *
658
717
  * Returns a new field descriptor. Its name, type, etc. must be set before it is
659
718
  * added to a message type.
@@ -687,10 +746,11 @@ static VALUE FieldDescriptor_initialize(VALUE _self, VALUE cookie,
687
746
  }
688
747
 
689
748
  /*
690
- * call-seq:
691
- * FieldDescriptor.name => name
749
+ * ruby-doc: FieldDescriptor#name
692
750
  *
693
751
  * Returns the name of this field.
752
+ *
753
+ * @return [String]
694
754
  */
695
755
  static VALUE FieldDescriptor_name(VALUE _self) {
696
756
  FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -755,14 +815,15 @@ static VALUE descriptortype_to_ruby(upb_FieldType type) {
755
815
  }
756
816
 
757
817
  /*
758
- * call-seq:
759
- * FieldDescriptor.type => type
818
+ * ruby-doc: FieldDescriptor#type
760
819
  *
761
820
  * Returns this field's type, as a Ruby symbol, or nil if not yet set.
762
821
  *
763
822
  * Valid field types are:
764
823
  * :int32, :int64, :uint32, :uint64, :float, :double, :bool, :string,
765
824
  * :bytes, :message.
825
+ *
826
+ * @return [Symbol]
766
827
  */
767
828
  static VALUE FieldDescriptor__type(VALUE _self) {
768
829
  FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -770,10 +831,11 @@ static VALUE FieldDescriptor__type(VALUE _self) {
770
831
  }
771
832
 
772
833
  /*
773
- * call-seq:
774
- * FieldDescriptor.default => default
834
+ * ruby-doc: FieldDescriptor#default
775
835
  *
776
836
  * Returns this field's default, as a Ruby object, or nil if not yet set.
837
+ *
838
+ * @return [Object,nil]
777
839
  */
778
840
  static VALUE FieldDescriptor_default(VALUE _self) {
779
841
  FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -788,10 +850,11 @@ static VALUE FieldDescriptor_default(VALUE _self) {
788
850
  }
789
851
 
790
852
  /*
791
- * call-seq:
792
- * FieldDescriptor.has_presence? => bool
853
+ * ruby-doc: FieldDescriptor.has_presence?
793
854
  *
794
855
  * Returns whether this field tracks presence.
856
+ *
857
+ * @return [Boolean]
795
858
  */
796
859
  static VALUE FieldDescriptor_has_presence(VALUE _self) {
797
860
  FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -799,10 +862,11 @@ static VALUE FieldDescriptor_has_presence(VALUE _self) {
799
862
  }
800
863
 
801
864
  /*
802
- * call-seq:
803
- * FieldDescriptor.required? => bool
865
+ * ruby-doc: FieldDescriptor#required?
804
866
  *
805
867
  * Returns whether this is a required field.
868
+ *
869
+ * @return [Boolean]
806
870
  */
807
871
  static VALUE FieldDescriptor_is_required(VALUE _self) {
808
872
  FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -810,10 +874,10 @@ static VALUE FieldDescriptor_is_required(VALUE _self) {
810
874
  }
811
875
 
812
876
  /*
813
- * call-seq:
814
- * FieldDescriptor.repeated? => bool
877
+ * ruby-doc: FieldDescriptor#repeated?
815
878
  *
816
879
  * Returns whether this is a repeated field.
880
+ * @return [Boolean]
817
881
  */
818
882
  static VALUE FieldDescriptor_is_repeated(VALUE _self) {
819
883
  FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -821,10 +885,10 @@ static VALUE FieldDescriptor_is_repeated(VALUE _self) {
821
885
  }
822
886
 
823
887
  /*
824
- * call-seq:
825
- * FieldDescriptor.is_packed? => bool
888
+ * ruby-doc: FieldDescriptor#is_packed?
826
889
  *
827
890
  * Returns whether this is a repeated field that uses packed encoding.
891
+ * @return [Boolean]
828
892
  */
829
893
  static VALUE FieldDescriptor_is_packed(VALUE _self) {
830
894
  FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -832,10 +896,11 @@ static VALUE FieldDescriptor_is_packed(VALUE _self) {
832
896
  }
833
897
 
834
898
  /*
835
- * call-seq:
836
- * FieldDescriptor.json_name => json_name
899
+ * ruby-doc: FieldDescriptor#json_name
837
900
  *
838
901
  * Returns this field's json_name, as a Ruby string, or nil if not yet set.
902
+ *
903
+ * @return [String,nil]
839
904
  */
840
905
  static VALUE FieldDescriptor_json_name(VALUE _self) {
841
906
  FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -845,15 +910,14 @@ static VALUE FieldDescriptor_json_name(VALUE _self) {
845
910
  }
846
911
 
847
912
  /*
848
- * DEPRECATED: Use repeated? or required? instead.
849
- *
850
- * call-seq:
851
- * FieldDescriptor.label => label
913
+ * ruby-doc: FieldDescriptor#label
852
914
  *
853
915
  * Returns this field's label (i.e., plurality), as a Ruby symbol.
854
- *
855
916
  * Valid field labels are:
856
- * :optional, :repeated
917
+ * :optional, :repeated
918
+ *
919
+ * @return [Symbol]
920
+ * @deprecated Use {#repeated?} or {#required?} instead.
857
921
  */
858
922
  static VALUE FieldDescriptor_label(VALUE _self) {
859
923
  FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -873,10 +937,11 @@ static VALUE FieldDescriptor_label(VALUE _self) {
873
937
  }
874
938
 
875
939
  /*
876
- * call-seq:
877
- * FieldDescriptor.number => number
940
+ * ruby-doc: FieldDescriptor#number
878
941
  *
879
942
  * Returns the tag number for this field.
943
+ *
944
+ * @return [Integer]
880
945
  */
881
946
  static VALUE FieldDescriptor_number(VALUE _self) {
882
947
  FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -884,13 +949,14 @@ static VALUE FieldDescriptor_number(VALUE _self) {
884
949
  }
885
950
 
886
951
  /*
887
- * call-seq:
888
- * FieldDescriptor.submsg_name => submsg_name
952
+ * ruby-doc: FieldDescriptor#submsg_name
889
953
  *
890
954
  * Returns the name of the message or enum type corresponding to this field, if
891
955
  * it is a message or enum field (respectively), or nil otherwise. This type
892
956
  * name will be resolved within the context of the pool to which the containing
893
957
  * message type is added.
958
+ *
959
+ * @return [String,nil]
894
960
  */
895
961
  static VALUE FieldDescriptor_submsg_name(VALUE _self) {
896
962
  FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -907,13 +973,14 @@ static VALUE FieldDescriptor_submsg_name(VALUE _self) {
907
973
  }
908
974
 
909
975
  /*
910
- * call-seq:
911
- * FieldDescriptor.subtype => message_or_enum_descriptor
976
+ * ruby-doc: FieldDescriptor#subtype
912
977
  *
913
978
  * Returns the message or enum descriptor corresponding to this field's type if
914
979
  * it is a message or enum field, respectively, or nil otherwise. Cannot be
915
980
  * called *until* the containing message type is added to a pool (and thus
916
981
  * resolved).
982
+ *
983
+ * @return [Descriptor,EnumDescriptor,nil]
917
984
  */
918
985
  static VALUE FieldDescriptor_subtype(VALUE _self) {
919
986
  FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -930,11 +997,13 @@ static VALUE FieldDescriptor_subtype(VALUE _self) {
930
997
  }
931
998
 
932
999
  /*
933
- * call-seq:
934
- * FieldDescriptor.get(message) => value
1000
+ * ruby-doc: FieldDescriptor#get
935
1001
  *
936
1002
  * Returns the value set for this field on the given message. Raises an
937
1003
  * exception if message is of the wrong type.
1004
+ *
1005
+ * @param message [AbstractMessage]
1006
+ * @return [Object]
938
1007
  */
939
1008
  static VALUE FieldDescriptor_get(VALUE _self, VALUE msg_rb) {
940
1009
  FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -950,11 +1019,13 @@ static VALUE FieldDescriptor_get(VALUE _self, VALUE msg_rb) {
950
1019
  }
951
1020
 
952
1021
  /*
953
- * call-seq:
954
- * FieldDescriptor.has?(message) => boolean
1022
+ * ruby-doc: FieldDescriptor.has?
955
1023
  *
956
1024
  * Returns whether the value is set on the given message. Raises an
957
1025
  * exception when calling for fields that do not have presence.
1026
+ *
1027
+ * @param message [AbstractMessage]
1028
+ * @return [Boolean]
958
1029
  */
959
1030
  static VALUE FieldDescriptor_has(VALUE _self, VALUE msg_rb) {
960
1031
  FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -971,10 +1042,12 @@ static VALUE FieldDescriptor_has(VALUE _self, VALUE msg_rb) {
971
1042
  }
972
1043
 
973
1044
  /*
974
- * call-seq:
975
- * FieldDescriptor.clear(message)
1045
+ * ruby-doc: FieldDescriptor#clear
976
1046
  *
977
1047
  * Clears the field from the message if it's set.
1048
+ *
1049
+ * @param message [AbstractMessage]
1050
+ * @return [nil]
978
1051
  */
979
1052
  static VALUE FieldDescriptor_clear(VALUE _self, VALUE msg_rb) {
980
1053
  FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -990,12 +1063,14 @@ static VALUE FieldDescriptor_clear(VALUE _self, VALUE msg_rb) {
990
1063
  }
991
1064
 
992
1065
  /*
993
- * call-seq:
994
- * FieldDescriptor.set(message, value)
1066
+ * ruby-doc: FieldDescriptor#set
995
1067
  *
996
1068
  * Sets the value corresponding to this field to the given value on the given
997
1069
  * message. Raises an exception if message is of the wrong type. Performs the
998
1070
  * ordinary type-checks for field setting.
1071
+ *
1072
+ * @param message [AbstractMessage]
1073
+ * @param value [Object]
999
1074
  */
1000
1075
  static VALUE FieldDescriptor_set(VALUE _self, VALUE msg_rb, VALUE value) {
1001
1076
  FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -1015,10 +1090,13 @@ static VALUE FieldDescriptor_set(VALUE _self, VALUE msg_rb, VALUE value) {
1015
1090
  }
1016
1091
 
1017
1092
  /*
1018
- * call-seq:
1019
- * FieldDescriptor.options => options
1093
+ * ruby-doc: FieldDescriptor#options
1094
+ *
1095
+ * Returns the
1096
+ * {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L656
1097
+ * FieldOptions} for this {FieldDescriptor}.
1020
1098
  *
1021
- * Returns the `FieldOptions` for this `FieldDescriptor`.
1099
+ * @return [FieldOptions]
1022
1100
  */
1023
1101
  static VALUE FieldDescriptor_options(VALUE _self) {
1024
1102
  FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -1034,10 +1112,13 @@ static VALUE FieldDescriptor_options(VALUE _self) {
1034
1112
  }
1035
1113
 
1036
1114
  /*
1037
- * call-seq:
1038
- * FieldDescriptor.to_proto => FieldDescriptorProto
1115
+ * ruby-doc: FieldDescriptor#to_proto
1116
+ *
1117
+ * Returns the
1118
+ * {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L236
1119
+ * FieldDescriptorProto} of this {FieldDescriptor}.
1039
1120
  *
1040
- * Returns the `FieldDescriptorProto` of this `FieldDescriptor`.
1121
+ * @return [FieldDescriptorProto]
1041
1122
  */
1042
1123
  static VALUE FieldDescriptor_to_proto(VALUE _self) {
1043
1124
  FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
@@ -1110,9 +1191,15 @@ static OneofDescriptor* ruby_to_OneofDescriptor(VALUE val) {
1110
1191
  return ret;
1111
1192
  }
1112
1193
 
1194
+ /**
1195
+ * ruby-doc: OneofDescriptor
1196
+ *
1197
+ * A OneofDescriptor provides information about the Protobuf definition of a
1198
+ * oneof inside a {Descriptor}.
1199
+ */
1200
+
1113
1201
  /*
1114
- * call-seq:
1115
- * OneofDescriptor.new => oneof_descriptor
1202
+ * ruby-doc: OneofDescriptor#initialize
1116
1203
  *
1117
1204
  * Creates a new, empty, oneof descriptor. The oneof may only be modified prior
1118
1205
  * to being added to a message descriptor which is subsequently added to a pool.
@@ -1147,10 +1234,11 @@ static VALUE OneofDescriptor_initialize(VALUE _self, VALUE cookie,
1147
1234
  }
1148
1235
 
1149
1236
  /*
1150
- * call-seq:
1151
- * OneofDescriptor.name => name
1237
+ * ruby-doc: OneofDescriptor#name
1152
1238
  *
1153
1239
  * Returns the name of this oneof.
1240
+ *
1241
+ * @return [String]
1154
1242
  */
1155
1243
  static VALUE OneofDescriptor_name(VALUE _self) {
1156
1244
  OneofDescriptor* self = ruby_to_OneofDescriptor(_self);
@@ -1158,10 +1246,12 @@ static VALUE OneofDescriptor_name(VALUE _self) {
1158
1246
  }
1159
1247
 
1160
1248
  /*
1161
- * call-seq:
1162
- * OneofDescriptor.each(&block) => nil
1249
+ * ruby-doc: OneofDescriptor#each
1163
1250
  *
1164
1251
  * Iterates through fields in this oneof, yielding to the block on each one.
1252
+ *
1253
+ * @yield [FieldDescriptor]
1254
+ * @return [nil]
1165
1255
  */
1166
1256
  static VALUE OneofDescriptor_each(VALUE _self) {
1167
1257
  OneofDescriptor* self = ruby_to_OneofDescriptor(_self);
@@ -1176,10 +1266,13 @@ static VALUE OneofDescriptor_each(VALUE _self) {
1176
1266
  }
1177
1267
 
1178
1268
  /*
1179
- * call-seq:
1180
- * OneofDescriptor.options => options
1269
+ * ruby-doc: OneofDescriptor#options
1270
+ *
1271
+ * Returns the
1272
+ * {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L824
1273
+ * OneofOptions} for this {OneofDescriptor}.
1181
1274
  *
1182
- * Returns the `OneofOptions` for this `OneofDescriptor`.
1275
+ * @return [OneofOptions]
1183
1276
  */
1184
1277
  static VALUE OneOfDescriptor_options(VALUE _self) {
1185
1278
  OneofDescriptor* self = ruby_to_OneofDescriptor(_self);
@@ -1195,10 +1288,13 @@ static VALUE OneOfDescriptor_options(VALUE _self) {
1195
1288
  }
1196
1289
 
1197
1290
  /*
1198
- * call-seq:
1199
- * OneofDescriptor.to_proto => OneofDescriptorProto
1291
+ * ruby-doc: OneofDescriptor#to_proto
1292
+ *
1293
+ * Returns the
1294
+ * {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L343
1295
+ * OneofDescriptorProto} of this {OneofDescriptor}.
1200
1296
  *
1201
- * Returns the `OneofDescriptorProto` of this `OneofDescriptor`.
1297
+ * @return [OneofDescriptorProto]
1202
1298
  */
1203
1299
  static VALUE OneOfDescriptor_to_proto(VALUE _self) {
1204
1300
  OneofDescriptor* self = ruby_to_OneofDescriptor(_self);
@@ -1275,6 +1371,13 @@ const upb_EnumDef* EnumDescriptor_GetEnumDef(VALUE enum_desc_rb) {
1275
1371
  return desc->enumdef;
1276
1372
  }
1277
1373
 
1374
+ /**
1375
+ * ruby-doc: EnumDescriptor
1376
+ *
1377
+ * An EnumDescriptor provides information about the Protobuf definition of an
1378
+ * enum inside a {Descriptor}.
1379
+ */
1380
+
1278
1381
  /*
1279
1382
  * call-seq:
1280
1383
  * EnumDescriptor.new(c_only_cookie, ptr) => EnumDescriptor
@@ -1297,10 +1400,11 @@ static VALUE EnumDescriptor_initialize(VALUE _self, VALUE cookie,
1297
1400
  }
1298
1401
 
1299
1402
  /*
1300
- * call-seq:
1301
- * EnumDescriptor.file_descriptor
1403
+ * ruby-doc: EnumDescriptor#file_descriptor
1302
1404
  *
1303
- * Returns the FileDescriptor object this enum belongs to.
1405
+ * Returns the {FileDescriptor} object this enum belongs to.
1406
+ *
1407
+ * @return [FileDescriptor]
1304
1408
  */
1305
1409
  static VALUE EnumDescriptor_file_descriptor(VALUE _self) {
1306
1410
  EnumDescriptor* self = ruby_to_EnumDescriptor(_self);
@@ -1309,10 +1413,11 @@ static VALUE EnumDescriptor_file_descriptor(VALUE _self) {
1309
1413
  }
1310
1414
 
1311
1415
  /*
1312
- * call-seq:
1313
- * EnumDescriptor.is_closed? => bool
1416
+ * ruby-doc: EnumDescriptor#is_closed?
1314
1417
  *
1315
1418
  * Returns whether this enum is open or closed.
1419
+ *
1420
+ * @return [Boolean]
1316
1421
  */
1317
1422
  static VALUE EnumDescriptor_is_closed(VALUE _self) {
1318
1423
  EnumDescriptor* self = ruby_to_EnumDescriptor(_self);
@@ -1320,10 +1425,11 @@ static VALUE EnumDescriptor_is_closed(VALUE _self) {
1320
1425
  }
1321
1426
 
1322
1427
  /*
1323
- * call-seq:
1324
- * EnumDescriptor.name => name
1428
+ * ruby-doc: EnumDescriptor#name
1325
1429
  *
1326
1430
  * Returns the name of this enum type.
1431
+ *
1432
+ * @return [String]
1327
1433
  */
1328
1434
  static VALUE EnumDescriptor_name(VALUE _self) {
1329
1435
  EnumDescriptor* self = ruby_to_EnumDescriptor(_self);
@@ -1331,11 +1437,13 @@ static VALUE EnumDescriptor_name(VALUE _self) {
1331
1437
  }
1332
1438
 
1333
1439
  /*
1334
- * call-seq:
1335
- * EnumDescriptor.lookup_name(name) => value
1440
+ * ruby-doc: EnumDescriptor#lookup_name
1336
1441
  *
1337
1442
  * Returns the numeric value corresponding to the given key name (as a Ruby
1338
1443
  * symbol), or nil if none.
1444
+ *
1445
+ * @param name [Symbol]
1446
+ * @return [Integer,nil]
1339
1447
  */
1340
1448
  static VALUE EnumDescriptor_lookup_name(VALUE _self, VALUE name) {
1341
1449
  EnumDescriptor* self = ruby_to_EnumDescriptor(_self);
@@ -1350,11 +1458,13 @@ static VALUE EnumDescriptor_lookup_name(VALUE _self, VALUE name) {
1350
1458
  }
1351
1459
 
1352
1460
  /*
1353
- * call-seq:
1354
- * EnumDescriptor.lookup_value(name) => value
1461
+ * ruby-doc: EnumDescriptor#lookup_value
1355
1462
  *
1356
1463
  * Returns the key name (as a Ruby symbol) corresponding to the integer value,
1357
1464
  * or nil if none.
1465
+ *
1466
+ * @param name [Integer]
1467
+ * @return [Symbol,nil]
1358
1468
  */
1359
1469
  static VALUE EnumDescriptor_lookup_value(VALUE _self, VALUE number) {
1360
1470
  EnumDescriptor* self = ruby_to_EnumDescriptor(_self);
@@ -1369,11 +1479,13 @@ static VALUE EnumDescriptor_lookup_value(VALUE _self, VALUE number) {
1369
1479
  }
1370
1480
 
1371
1481
  /*
1372
- * call-seq:
1373
- * EnumDescriptor.each(&block)
1482
+ * ruby-doc: EnumDescriptor#each
1374
1483
  *
1375
1484
  * Iterates over key => value mappings in this enum's definition, yielding to
1376
1485
  * the block with (key, value) arguments for each one.
1486
+ *
1487
+ * @yield [Symbol, Integer]
1488
+ * @return [nil]
1377
1489
  */
1378
1490
  static VALUE EnumDescriptor_each(VALUE _self) {
1379
1491
  EnumDescriptor* self = ruby_to_EnumDescriptor(_self);
@@ -1390,10 +1502,11 @@ static VALUE EnumDescriptor_each(VALUE _self) {
1390
1502
  }
1391
1503
 
1392
1504
  /*
1393
- * call-seq:
1394
- * EnumDescriptor.enummodule => module
1505
+ * ruby-doc: EnumDescriptor#enummodule
1395
1506
  *
1396
1507
  * Returns the Ruby module corresponding to this enum type.
1508
+ *
1509
+ * @return [Module]
1397
1510
  */
1398
1511
  static VALUE EnumDescriptor_enummodule(VALUE _self) {
1399
1512
  EnumDescriptor* self = ruby_to_EnumDescriptor(_self);
@@ -1404,10 +1517,13 @@ static VALUE EnumDescriptor_enummodule(VALUE _self) {
1404
1517
  }
1405
1518
 
1406
1519
  /*
1407
- * call-seq:
1408
- * EnumDescriptor.options => options
1520
+ * ruby-doc: EnumDescriptor#options
1409
1521
  *
1410
- * Returns the `EnumOptions` for this `EnumDescriptor`.
1522
+ * Returns the
1523
+ * {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L838
1524
+ * EnumOptions} for this {EnumDescriptor}.
1525
+ *
1526
+ * @return [EnumOptions]
1411
1527
  */
1412
1528
  static VALUE EnumDescriptor_options(VALUE _self) {
1413
1529
  EnumDescriptor* self = ruby_to_EnumDescriptor(_self);
@@ -1422,10 +1538,12 @@ static VALUE EnumDescriptor_options(VALUE _self) {
1422
1538
  }
1423
1539
 
1424
1540
  /*
1425
- * call-seq:
1426
- * EnumDescriptor.to_proto => EnumDescriptorProto
1541
+ * ruby-doc: EnumDescriptor#to_proto
1427
1542
  *
1428
- * Returns the `EnumDescriptorProto` of this `EnumDescriptor`.
1543
+ * Returns the
1544
+ * {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L349
1545
+ * EnumDescriptorProto} of this {EnumDescriptor}.
1546
+ * @return [EnumDescriptorProto]
1429
1547
  */
1430
1548
  static VALUE EnumDescriptor_to_proto(VALUE _self) {
1431
1549
  EnumDescriptor* self = ruby_to_EnumDescriptor(_self);
@@ -1503,6 +1621,13 @@ static VALUE ServiceDescriptor_alloc(VALUE klass) {
1503
1621
  return ret;
1504
1622
  }
1505
1623
 
1624
+ /**
1625
+ * ruby-doc: ServiceDescriptor
1626
+ *
1627
+ * A ServiceDescriptor provides information about the Protobuf definition of an
1628
+ * RPC service.
1629
+ */
1630
+
1506
1631
  /*
1507
1632
  * call-seq:
1508
1633
  * ServiceDescriptor.new(c_only_cookie, ptr) => ServiceDescriptor
@@ -1525,10 +1650,11 @@ static VALUE ServiceDescriptor_initialize(VALUE _self, VALUE cookie,
1525
1650
  }
1526
1651
 
1527
1652
  /*
1528
- * call-seq:
1529
- * ServiceDescriptor.name => name
1653
+ * ruby-doc: ServiceDescriptor#name
1530
1654
  *
1531
1655
  * Returns the name of this service.
1656
+ *
1657
+ * @return [String]
1532
1658
  */
1533
1659
  static VALUE ServiceDescriptor_name(VALUE _self) {
1534
1660
  ServiceDescriptor* self = ruby_to_ServiceDescriptor(_self);
@@ -1536,10 +1662,10 @@ static VALUE ServiceDescriptor_name(VALUE _self) {
1536
1662
  }
1537
1663
 
1538
1664
  /*
1539
- * call-seq:
1540
- * ServiceDescriptor.file_descriptor
1665
+ * ruby-doc: ServiceDescriptor#file_descriptor
1541
1666
  *
1542
- * Returns the FileDescriptor object this service belongs to.
1667
+ * Returns the {FileDescriptor} object this service belongs to.
1668
+ * @return [FileDescriptor]
1543
1669
  */
1544
1670
  static VALUE ServiceDescriptor_file_descriptor(VALUE _self) {
1545
1671
  ServiceDescriptor* self = ruby_to_ServiceDescriptor(_self);
@@ -1548,10 +1674,12 @@ static VALUE ServiceDescriptor_file_descriptor(VALUE _self) {
1548
1674
  }
1549
1675
 
1550
1676
  /*
1551
- * call-seq:
1552
- * ServiceDescriptor.each(&block)
1677
+ * ruby-doc: ServiceDescriptor#each
1553
1678
  *
1554
1679
  * Iterates over methods in this service, yielding to the block on each one.
1680
+ *
1681
+ * @yield [MethodDescriptor]
1682
+ * @return [nil]
1555
1683
  */
1556
1684
  static VALUE ServiceDescriptor_each(VALUE _self) {
1557
1685
  ServiceDescriptor* self = ruby_to_ServiceDescriptor(_self);
@@ -1566,10 +1694,13 @@ static VALUE ServiceDescriptor_each(VALUE _self) {
1566
1694
  }
1567
1695
 
1568
1696
  /*
1569
- * call-seq:
1570
- * ServiceDescriptor.options => options
1697
+ * ruby-doc: ServiceDescriptor#options
1571
1698
  *
1572
- * Returns the `ServiceOptions` for this `ServiceDescriptor`.
1699
+ * Returns the
1700
+ * {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L901
1701
+ * ServiceOptions} for this {ServiceDescriptor}.
1702
+ *
1703
+ * @return [ServiceOptions]
1573
1704
  */
1574
1705
  static VALUE ServiceDescriptor_options(VALUE _self) {
1575
1706
  ServiceDescriptor* self = ruby_to_ServiceDescriptor(_self);
@@ -1586,10 +1717,13 @@ static VALUE ServiceDescriptor_options(VALUE _self) {
1586
1717
  }
1587
1718
 
1588
1719
  /*
1589
- * call-seq:
1590
- * ServiceDescriptor.to_proto => ServiceDescriptorProto
1720
+ * ruby-doc: ServiceDescriptor#to_proto
1591
1721
  *
1592
- * Returns the `ServiceDescriptorProto` of this `ServiceDescriptor`.
1722
+ * Returns the
1723
+ * {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L386
1724
+ * ServiceDescriptorProto} of this {ServiceDescriptor}.
1725
+ *
1726
+ * @return [ServiceDescriptorProto]
1593
1727
  */
1594
1728
  static VALUE ServiceDescriptor_to_proto(VALUE _self) {
1595
1729
  ServiceDescriptor* self = ruby_to_ServiceDescriptor(_self);
@@ -1662,6 +1796,13 @@ static VALUE MethodDescriptor_alloc(VALUE klass) {
1662
1796
  return ret;
1663
1797
  }
1664
1798
 
1799
+ /**
1800
+ * ruby-doc: MethodDescriptor
1801
+ *
1802
+ * A MethodDescriptor provides information about the Protobuf definition of a
1803
+ * method inside an RPC service.
1804
+ */
1805
+
1665
1806
  /*
1666
1807
  * call-seq:
1667
1808
  * MethodDescriptor.new(c_only_cookie, ptr) => MethodDescriptor
@@ -1684,10 +1825,11 @@ static VALUE MethodDescriptor_initialize(VALUE _self, VALUE cookie,
1684
1825
  }
1685
1826
 
1686
1827
  /*
1687
- * call-seq:
1688
- * MethodDescriptor.name => name
1828
+ * ruby-doc: MethodDescriptor#name
1689
1829
  *
1690
1830
  * Returns the name of this method
1831
+ *
1832
+ * @return [String]
1691
1833
  */
1692
1834
  static VALUE MethodDescriptor_name(VALUE _self) {
1693
1835
  MethodDescriptor* self = ruby_to_MethodDescriptor(_self);
@@ -1695,10 +1837,13 @@ static VALUE MethodDescriptor_name(VALUE _self) {
1695
1837
  }
1696
1838
 
1697
1839
  /*
1698
- * call-seq:
1699
- * MethodDescriptor.options => options
1840
+ * ruby-doc: MethodDescriptor#options
1700
1841
  *
1701
- * Returns the `MethodOptions` for this `MethodDescriptor`.
1842
+ * Returns the
1843
+ * {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L927
1844
+ * MethodOptions} for this {MethodDescriptor}.
1845
+ *
1846
+ * @return [MethodOptions]
1702
1847
  */
1703
1848
  static VALUE MethodDescriptor_options(VALUE _self) {
1704
1849
  MethodDescriptor* self = ruby_to_MethodDescriptor(_self);
@@ -1715,10 +1860,11 @@ static VALUE MethodDescriptor_options(VALUE _self) {
1715
1860
  }
1716
1861
 
1717
1862
  /*
1718
- * call-seq:
1719
- * MethodDescriptor.input_type => Descriptor
1863
+ * ruby-doc: MethodDescriptor#input_type
1720
1864
  *
1721
- * Returns the `Descriptor` for the request message type of this method
1865
+ * Returns the {Descriptor} for the request message type of this method
1866
+ *
1867
+ * @return [Descriptor]
1722
1868
  */
1723
1869
  static VALUE MethodDescriptor_input_type(VALUE _self) {
1724
1870
  MethodDescriptor* self = ruby_to_MethodDescriptor(_self);
@@ -1727,10 +1873,11 @@ static VALUE MethodDescriptor_input_type(VALUE _self) {
1727
1873
  }
1728
1874
 
1729
1875
  /*
1730
- * call-seq:
1731
- * MethodDescriptor.output_type => Descriptor
1876
+ * ruby-doc: MethodDescriptor#output_type
1877
+ *
1878
+ * Returns the {Descriptor} for the response message type of this method
1732
1879
  *
1733
- * Returns the `Descriptor` for the response message type of this method
1880
+ * @return [Descriptor]
1734
1881
  */
1735
1882
  static VALUE MethodDescriptor_output_type(VALUE _self) {
1736
1883
  MethodDescriptor* self = ruby_to_MethodDescriptor(_self);
@@ -1739,10 +1886,11 @@ static VALUE MethodDescriptor_output_type(VALUE _self) {
1739
1886
  }
1740
1887
 
1741
1888
  /*
1742
- * call-seq:
1743
- * MethodDescriptor.client_streaming => bool
1889
+ * ruby-doc: MethodDescriptor#client_streaming
1744
1890
  *
1745
1891
  * Returns whether or not this is a streaming request method
1892
+ *
1893
+ * @return [Boolean]
1746
1894
  */
1747
1895
  static VALUE MethodDescriptor_client_streaming(VALUE _self) {
1748
1896
  MethodDescriptor* self = ruby_to_MethodDescriptor(_self);
@@ -1750,10 +1898,13 @@ static VALUE MethodDescriptor_client_streaming(VALUE _self) {
1750
1898
  }
1751
1899
 
1752
1900
  /*
1753
- * call-seq:
1754
- * MethodDescriptor.to_proto => MethodDescriptorProto
1901
+ * ruby-doc: MethodDescriptor#to_proto
1902
+ *
1903
+ * Returns the
1904
+ * {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L394
1905
+ * MethodDescriptorProto} of this {MethodDescriptor}.
1755
1906
  *
1756
- * Returns the `MethodDescriptorProto` of this `MethodDescriptor`.
1907
+ * @return [MethodDescriptorProto]
1757
1908
  */
1758
1909
  static VALUE MethodDescriptor_to_proto(VALUE _self) {
1759
1910
  MethodDescriptor* self = ruby_to_MethodDescriptor(_self);
@@ -1771,10 +1922,11 @@ static VALUE MethodDescriptor_to_proto(VALUE _self) {
1771
1922
  }
1772
1923
 
1773
1924
  /*
1774
- * call-seq:
1775
- * MethodDescriptor.server_streaming => bool
1925
+ * ruby-doc: MethodDescriptor#server_streaming
1776
1926
  *
1777
1927
  * Returns whether or not this is a streaming response method
1928
+ *
1929
+ * @return [Boolean]
1778
1930
  */
1779
1931
  static VALUE MethodDescriptor_server_streaming(VALUE _self) {
1780
1932
  MethodDescriptor* self = ruby_to_MethodDescriptor(_self);