Class: Binary

Inherits:
Object show all
Defined in:
lib/mongo_mapper/support.rb

Class Method Summary collapse

Class Method Details

.from_mongo(value) ⇒ Object



25
26
27
# File 'lib/mongo_mapper/support.rb', line 25

def self.from_mongo(value)
  value
end

.to_mongo(value) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/mongo_mapper/support.rb', line 17

def self.to_mongo(value)
  if value.is_a?(ByteBuffer)
    value
  else
    value.nil? ? nil : ByteBuffer.new(value)
  end
end