Module: BSON::Hash::ClassMethods
- Defined in:
- lib/bson/hash.rb
Overview
Instance Method Summary collapse
-
#from_bson(buffer) ⇒ Array
Deserialize the hash from BSON.
Instance Method Details
#from_bson(buffer) ⇒ Array
Deserialize the hash from BSON.
75 76 77 78 79 80 81 82 83 |
# File 'lib/bson/hash.rb', line 75 def from_bson(buffer) hash = Document.allocate buffer.get_int32 # Throw away the size. while (type = buffer.get_byte) != NULL_BYTE field = buffer.get_cstring hash.store(field, BSON::Registry.get(type).from_bson(buffer)) end hash end |