Module: Moneta::Transformer::Helper::BSON Private

Extended by:
BSON
Included in:
BSON
Defined in:
lib/moneta/transformer/helper/bson.rb

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

Instance Method Summary collapse

Instance Method Details

#dump(value) ⇒ Object

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.



13
14
15
# File 'lib/moneta/transformer/helper/bson.rb', line 13

def dump(value)
  ::BSON::Document['v' => value].to_bson.to_s
end

#load(value) ⇒ Object

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.



9
10
11
# File 'lib/moneta/transformer/helper/bson.rb', line 9

def load(value)
  ::BSON::Document.from_bson(::BSON::ByteBuffer.new(value))['v']
end