Class: Mongo::Binary

Inherits:
ByteBuffer show all
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

Attributes inherited from ByteBuffer

#order

Instance Method Summary collapse

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.



32
33
34
35
# File 'lib/mongo/types/binary.rb', line 32

def initialize(initial_data=[], subtype=SUBTYPE_BYTES)
  super(initial_data)
  @subtype = subtype
end

Instance Attribute Details

#subtypeObject

One of the SUBTYPE_* constants. Default is SUBTYPE_BYTES.



30
31
32
# File 'lib/mongo/types/binary.rb', line 30

def subtype
  @subtype
end