Module: BSON::Hash::ClassMethods
- Defined in:
- lib/bson/hash.rb
Overview
The methods to augment the Hash class with (class-level methods).
Instance Method Summary collapse
-
#from_bson(buffer, **options) ⇒ Hash
Deserialize the hash from BSON.
Instance Method Details
#from_bson(buffer, **options) ⇒ Hash
Note:
If the argument cannot be parsed, an exception will be raised and the argument will be left in an undefined state. The caller must explicitly call ‘rewind` on the buffer before trying to parse it again.
Deserialize the hash from BSON.
137 138 139 140 141 142 143 144 |
# File 'lib/bson/hash.rb', line 137 def from_bson(buffer, **) if buffer.respond_to?(:get_hash) buffer.get_hash(**) else hash = parse_hash_from_buffer(buffer, **) maybe_dbref(hash) end end |