Method: Mongo::Protocol::Serializers::BitVector#serialize
- Defined in:
- lib/mongo/protocol/bit_vector.rb
#serialize(buffer, value, validating_keys = nil) ⇒ String
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.
Serializes vector by encoding each symbol according to its mask
46 47 48 49 50 |
# File 'lib/mongo/protocol/bit_vector.rb', line 46 def serialize(buffer, value, validating_keys = nil) bits = 0 value.each { |flag| bits |= (@masks[flag] || 0) } buffer.put_int32(bits) end |