lib/mongo/protocol/serializers.rb in mongo-2.12.1 vs lib/mongo/protocol/serializers.rb in mongo-2.12.2

- old
+ new

@@ -438,15 +438,18 @@ end # Deserializes bytes from the byte buffer. # # @param [ BSON::ByteBuffer ] buffer Buffer containing the value to read. - # @param [ Integer ] num_bytes Number of bytes to read. + # @param [ Hash ] options The method options. # + # @option options [ Integer ] num_bytes Number of bytes to read. + # # @return [ String ] The bytes. # # @since 2.5.0 - def self.deserialize(buffer, num_bytes = nil) + def self.deserialize(buffer, options = {}) + num_bytes = options[:num_bytes] buffer.get_bytes(num_bytes || buffer.length) end end end end