msgpack-ruby
msgpack-ruby copied to clipboard
Inconsistent return value of `#to_msgpack(packer)`
#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?
build_msgpacker(packer) #=> packer
sounds good to me.
No justification other than that it sounds good.
Anyone have a better idea?
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.