msgpack-ruby icon indicating copy to clipboard operation
msgpack-ruby copied to clipboard

Inconsistent return value of `#to_msgpack(packer)`

Open tagomoris opened this issue 8 years ago • 2 comments

#to_msgpack(packer) returns given packer instance, not msgpack string. Generally, #to_x method returns instance of x in Ruby way. Current behavior is very confusing.

Returning packer is for recursive packing, so we need to add another method for it. See also: https://github.com/msgpack/msgpack-ruby/pull/116#issuecomment-221475038

What's the best name of that method?

tagomoris avatar Jun 23 '16 09:06 tagomoris

build_msgpacker(packer) #=> packer sounds good to me.
No justification other than that it sounds good.
Anyone have a better idea?

khalilfazal avatar Jan 05 '17 17:01 khalilfazal

This is an interesting design discussion, but I'm tempted since it was just an idea, and there's been no movement by anyone interested since early 2017, to close.

chrisseaton avatar Jul 20 '22 12:07 chrisseaton