Class: Aerospike::Packer

Inherits:
MessagePack::Packer
  • Object
show all
Defined in:
lib/aerospike/utils/packer.rb

Overview

:nodoc:

Constant Summary collapse

AS_EXT_TYPE =
-1
@@pool =
Pool.new

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.useObject



34
35
36
37
38
39
40
# File 'lib/aerospike/utils/packer.rb', line 34

def self.use
  packer = @@pool.poll
  packer.clear
  yield packer
ensure
  @@pool.offer(packer)
end

Instance Method Details

#bytesObject



47
48
49
# File 'lib/aerospike/utils/packer.rb', line 47

def bytes
  self.to_s.force_encoding('binary')
end

#write_raw_short(val) ⇒ Object

WARNING: This method is not compatible with message pack standard.



43
44
45
# File 'lib/aerospike/utils/packer.rb', line 43

def write_raw_short(val)
  buffer << [val].pack("S>")
end