We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7f46606 commit 19858f6Copy full SHA for 19858f6
1 file changed
mrblib/msgpack.rb
@@ -0,0 +1,13 @@
1
+module MessagePack
2
+ def self.register_ext_type(type, klass, pack:, unpack:)
3
+ pack = pack.to_proc if pack.respond_to?(:to_proc)
4
+ raise ArgumentError unless pack.is_a?(Proc)
5
+ unpack = unpack.to_proc if unpack.respond_to?(:to_proc)
6
+ raise ArgumentError unless unpack.is_a?(Proc)
7
+
8
+ register_pack_type(type, klass, &pack)
9
+ register_unpack_type(type, &unpack)
10
11
+ nil
12
+ end
13
+end
0 commit comments