Method: MongoDoc::BSON.decode

Defined in:
lib/mongo_doc/bson.rb

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



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/mongo_doc/bson.rb', line 7

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