Class: Binary

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

Class Method Summary collapse

Class Method Details

.from_mongo(value) ⇒ Object



24
25
26
# File 'lib/mongomapper/support.rb', line 24

def self.from_mongo(value)
  value
end

.to_mongo(value) ⇒ Object



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

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