Method: MongoDoc::BSON.decode

Defined in:
lib/mongodoc/bson.rb

.decode(bson, options = {}) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/mongodoc/bson.rb', line 21

def self.decode(bson, options = {})
  return bson if options[:raw_json]
  case bson
  when Hash
    bson_create(bson, options)
  when Array
    array_create(bson, options)
  else
    bson
  end
end