def to_bson(buffer = ByteBuffer.new, validating_keys = Config.validating_keys?)
      buffer.put_string(javascript) # @todo: was formerly to_bson_string
    end
def to_bson(buffer = ByteBuffer.new, validating_keys = Config.validating_keys?)
      buffer.put_string(javascript) # @todo: was formerly to_bson_string
    end
Instantiate the new code.

 @example Instantiate the new code.
   BSON::Code.new("this.value = 5")

 @param [ String ] javascript The javascript code.

 @since 2.0.0
 Encode the javascript code.

 @example Encode the code.
   code.to_bson

 @return [ BSON::ByteBuffer ] The buffer with the encoded object.

 @see http://bsonspec.org/#/specification

 @since 2.0.0