Method: Mongo::Grid::File::Info#initialize
- Defined in:
- lib/mongo/grid/file/info.rb
#initialize(document) ⇒ Info
Create the new file information document.
139 140 141 142 143 144 145 146 147 148 |
# File 'lib/mongo/grid/file/info.rb', line 139 def initialize(document) @client_md5 = Digest::MD5.new unless document[:disable_md5] == true # document contains a mix of user options and keys added # internally by the driver, like session. # Remove the keys that driver adds but keep user options. document = document.reject do |key, value| key.to_s == 'session' end @document = default_document.merge(Options::Mapper.transform(document, MAPPINGS)) end |