Commit d1a3c6d
For Ruby oneof fields, generate hazzers for members (#11655)
When generating Ruby clients for proto3 messages that have a oneof, we generate a hazzer for members of the oneof, not just a hazzer for the oneof itself.
In other words, for a proto like this:
```
syntax = "proto3";
message Foo {
oneof bar {
string baz = 1;
}
}
```
The generated `Foo` will now have a method called `has_baz?`, in addition to the (pre-existing) method `has_bar?`.
I updated the unit tests, and verified that all the tests under `//ruby/...` pass.
Fixes #9561.
Closes #11655
COPYBARA_INTEGRATE_REVIEW=#11655 from shaldengeki:test-ruby-oneof-hazzer a15e474
PiperOrigin-RevId: 5060909301 parent 96b1fce commit d1a3c6d
File tree
3 files changed
+17
-43
lines changed- ruby
- ext/google/protobuf_c
- src/main/java/com/google/protobuf/jruby
- tests
3 files changed
+17
-43
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | 246 | | |
256 | 247 | | |
257 | 248 | | |
| |||
1287 | 1278 | | |
1288 | 1279 | | |
1289 | 1280 | | |
1290 | | - | |
| 1281 | + | |
1291 | 1282 | | |
1292 | 1283 | | |
1293 | | - | |
1294 | | - | |
1295 | | - | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
1296 | 1287 | | |
1297 | 1288 | | |
1298 | 1289 | | |
| |||
Lines changed: 2 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
| 309 | + | |
314 | 310 | | |
315 | 311 | | |
316 | 312 | | |
| |||
459 | 455 | | |
460 | 456 | | |
461 | 457 | | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
| 458 | + | |
467 | 459 | | |
468 | 460 | | |
469 | 461 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
122 | 123 | | |
123 | 124 | | |
124 | | - | |
125 | | - | |
126 | | - | |
| 125 | + | |
127 | 126 | | |
128 | 127 | | |
129 | 128 | | |
| |||
716 | 715 | | |
717 | 716 | | |
718 | 717 | | |
719 | | - | |
| 718 | + | |
720 | 719 | | |
721 | 720 | | |
722 | | - | |
723 | | - | |
724 | | - | |
725 | | - | |
726 | | - | |
727 | | - | |
728 | | - | |
729 | | - | |
730 | | - | |
731 | | - | |
732 | | - | |
733 | | - | |
734 | | - | |
735 | | - | |
736 | | - | |
737 | | - | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
738 | 729 | | |
739 | 730 | | |
0 commit comments