Class: XGen::Mongo::Driver::Binary
- Inherits:
-
ByteBuffer
- Object
- ByteBuffer
- XGen::Mongo::Driver::Binary
- Defined in:
- lib/mongo/types/binary.rb
Overview
An array of binary bytes with a Mongo subtype value.
Constant Summary collapse
- SUBTYPE_BYTES =
0x02
- SUBTYPE_UUID =
0x03
- SUBTYPE_MD5 =
0x05
- SUBTYPE_USER_DEFINED =
0x80
Instance Attribute Summary collapse
-
#subtype ⇒ Object
One of the SUBTYPE_* constants.
Attributes inherited from ByteBuffer
Instance Method Summary collapse
-
#initialize(initial_data = [], subtype = SUBTYPE_BYTES) ⇒ Binary
constructor
A new instance of Binary.
Methods inherited from ByteBuffer
#clear, #dump, #get, #get_double, #get_int, #get_long, #more?, #position, #position=, #put, #put_array, #put_double, #put_int, #put_long, #rewind, #size, #to_a, #to_s
Constructor Details
#initialize(initial_data = [], subtype = SUBTYPE_BYTES) ⇒ Binary
Returns a new instance of Binary.
34 35 36 37 |
# File 'lib/mongo/types/binary.rb', line 34 def initialize(initial_data=[], subtype=SUBTYPE_BYTES) super(initial_data) @subtype = subtype end |
Instance Attribute Details
#subtype ⇒ Object
One of the SUBTYPE_* constants. Default is SUBTYPE_BYTES.
32 33 34 |
# File 'lib/mongo/types/binary.rb', line 32 def subtype @subtype end |