diff --git a/lib/bson/binary.rb b/lib/bson/binary.rb index c4a06cae3..efa4f6856 100644 --- a/lib/bson/binary.rb +++ b/lib/bson/binary.rb @@ -96,6 +96,18 @@ def initialize(data = "", type = :generic) @type = type end + # Get a nice string for use with object inspection. + # + # @example Inspect the binary. + # object_id.inspect + # + # @return [ String ] The binary in form BSON::Binary:object_id + # + # @since 2.3.0 + def inspect + "BSON::Binary:#{object_id}" + end + # Encode the binary type # # @example Encode the binary.