Skip to content

Commit

Permalink
RUBY-2264 add note documenting the behavior of the buffer in an error…
Browse files Browse the repository at this point in the history
… condition (#312)
  • Loading branch information
jamis committed Jul 5, 2023
1 parent 9484d2a commit c8a20b4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/bson/array.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ module ClassMethods

# Deserialize the array from BSON.
#
# @note If the argument cannot be parsed, an exception will be raised
# and the argument will be left in an undefined state. The caller
# must explicitly call `rewind` on the buffer before trying to parse
# it again.
#
# @param [ ByteBuffer ] buffer The byte buffer.
#
# @option options [ nil | :bson ] :mode Decoding mode to use.
Expand Down
5 changes: 5 additions & 0 deletions lib/bson/hash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ module ClassMethods

# Deserialize the hash from BSON.
#
# @note If the argument cannot be parsed, an exception will be raised
# and the argument will be left in an undefined state. The caller
# must explicitly call `rewind` on the buffer before trying to parse
# it again.
#
# @param [ ByteBuffer ] buffer The byte buffer.
#
# @option options [ nil | :bson ] :mode Decoding mode to use.
Expand Down
5 changes: 5 additions & 0 deletions lib/bson/regexp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,11 @@ module ClassMethods

# Deserialize the regular expression from BSON.
#
# @note If the argument cannot be parsed, an exception will be raised
# and the argument will be left in an undefined state. The caller
# must explicitly call `rewind` on the buffer before trying to parse
# it again.
#
# @param [ ByteBuffer ] buffer The byte buffer.
#
# @option opts [ nil | :bson ] :mode Decoding mode to use.
Expand Down

0 comments on commit c8a20b4

Please sign in to comment.