Method: Mongo::Crypt::Binary.from_data

Defined in:
lib/mongo/crypt/binary.rb

.from_data(data) ⇒ Mongo::Crypt::Binary

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Initialize a Binary object with a string. The Binary object will store a copy of the specified string and destroy the allocated memory when it goes out of scope.

Parameters:

  • data (String)

    A string to be wrapped by the Binary object

Returns:



87
88
89
# File 'lib/mongo/crypt/binary.rb', line 87

def self.from_data(data)
  self.new(data: data)
end