Fix to_cbor usage
1 files changed, 7 insertions(+), 2 deletions(-) M lib/dhall/binary.rb
M lib/dhall/binary.rb => lib/dhall/binary.rb +7 -2
@@ 26,8 26,13 @@ module Dhall new(*args) end - def to_cbor(io=nil) - CBOR.encode(as_json, io) + def to_cbor(packer=nil) + if packer + packer.write(as_json) + packer + else + CBOR.encode(as_json) + end end alias to_binary to_cbor