Class: Binary

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

Class Method Summary collapse

Class Method Details

.from_mongo(value) ⇒ Object



23
24
25
# File 'lib/mongo_mapper/support.rb', line 23

def self.from_mongo(value)
  value
end

.to_mongo(value) ⇒ Object



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

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