module BSON::OpenStruct
def to_bson(buffer = ByteBuffer.new)
- Since: - 4.2.0
Other tags:
- See: http://bsonspec.org/#/specification -
Returns:
-
(BSON::ByteBuffer)
- The buffer with the encoded object.
Other tags:
- Example: Get the OpenStruct object as encoded BSON. -
def to_bson(buffer = ByteBuffer.new) if Environment.ruby_1_9? marshal_dump.dup else to_h end.to_bson(buffer) end