Class: Aerospike::Packer
- Inherits:
-
MessagePack::Packer
- Object
- MessagePack::Packer
- Aerospike::Packer
- Defined in:
- lib/aerospike/utils/packer.rb
Overview
:nodoc:
Constant Summary collapse
Class Method Summary collapse
Instance Method Summary collapse
- #bytes ⇒ Object
- #write_raw(buf) ⇒ Object
-
#write_raw_short(val) ⇒ Object
WARNING: This method is not compatible with message pack standard.
Class Method Details
.use ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/aerospike/utils/packer.rb', line 32 def self.use packer = @@pool.poll packer.clear yield packer ensure @@pool.offer(packer) end |
Instance Method Details
#bytes ⇒ Object
49 50 51 |
# File 'lib/aerospike/utils/packer.rb', line 49 def bytes self.to_s.force_encoding("binary") end |
#write_raw(buf) ⇒ Object
45 46 47 |
# File 'lib/aerospike/utils/packer.rb', line 45 def write_raw(buf) buffer.write(buf) end |
#write_raw_short(val) ⇒ Object
WARNING: This method is not compatible with message pack standard.
41 42 43 |
# File 'lib/aerospike/utils/packer.rb', line 41 def write_raw_short(val) buffer << [val].pack("S>") end |