-
Notifications
You must be signed in to change notification settings - Fork 15.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add native type setters for Timestamp and Duration in Ruby #5751
Conversation
char* value_type_name = rb_class2name(CLASS_OF(value)); | ||
|
||
// Time -> Google::Protobuf::Timestamp | ||
if (strcmp(field_type_name, "Google::Protobuf::Timestamp") == 0 && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
upb provides upb_msgdef_wellknowntype. You don't need strcmp here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... I couldn't find too many usages of that method. How can I get the upb_msgdef
from the type_class
in order to use it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok.. seems you cannot get msgdef from type_class
Please sync |
Is there native types for duration in ruby? |
@TeBoring I've sync'd this with master. |
It needs to be synced again. |
@TeBoring sync'd. |
@TeBoring any updates on this? |
Resolves #3121 by adding additional setters for fields of type
Google::Protobuf::Timestamp
andGoogle::Protobuf::Duration
.This allows a message with a
Timestamp
field to be set via:Similarly, for
Duration
fields: