aboutsummaryrefslogtreecommitdiff
path: root/ruby/ext/google/protobuf_c/protobuf.c
diff options
context:
space:
mode:
authorChris Fallin <cfallin@c1f.net>2015-01-06 15:44:09 -0800
committerChris Fallin <cfallin@c1f.net>2015-01-06 15:44:09 -0800
commitfd1a3ff11d5854c34ba66c63598cdc5fd234e399 (patch)
treebac4a2445906d444a132004761f6b8e1693a9124 /ruby/ext/google/protobuf_c/protobuf.c
parent644a6a1da71385e9d7a7a26b3476c93fdd71788c (diff)
downloadprotobuf-fd1a3ff11d5854c34ba66c63598cdc5fd234e399.tar.gz
protobuf-fd1a3ff11d5854c34ba66c63598cdc5fd234e399.tar.bz2
protobuf-fd1a3ff11d5854c34ba66c63598cdc5fd234e399.zip
Support for maps in the MRI C Ruby extension.
This adds the Map container and support for parsing and serializing maps in the protobuf wire format (as defined by the C++ implementation, with MapEntry submessages in a repeated field). JSON map serialization/parsing are not yet supported as these will require some changes to upb as well.
Diffstat (limited to 'ruby/ext/google/protobuf_c/protobuf.c')
-rw-r--r--ruby/ext/google/protobuf_c/protobuf.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ruby/ext/google/protobuf_c/protobuf.c b/ruby/ext/google/protobuf_c/protobuf.c
index d5862284..30552705 100644
--- a/ruby/ext/google/protobuf_c/protobuf.c
+++ b/ruby/ext/google/protobuf_c/protobuf.c
@@ -82,6 +82,7 @@ void Init_protobuf_c() {
EnumBuilderContext_register(internal);
Builder_register(internal);
RepeatedField_register(protobuf);
+ Map_register(protobuf);
rb_define_singleton_method(protobuf, "encode", Google_Protobuf_encode, 1);
rb_define_singleton_method(protobuf, "decode", Google_Protobuf_decode, 2);