Class: Memory::Wrapper
- Inherits:
-
MessagePack::Factory
- Object
- MessagePack::Factory
- Memory::Wrapper
- Defined in:
- lib/memory/sampler.rb
Instance Method Summary collapse
-
#initialize(cache) ⇒ Wrapper
constructor
A new instance of Wrapper.
Constructor Details
#initialize(cache) ⇒ Wrapper
Returns a new instance of Wrapper.
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/memory/sampler.rb', line 29 def initialize(cache) super() @cache = cache self.register_type(0x01, Allocation, packer: ->(instance){self.pack(instance.pack)}, unpacker: ->(data){Allocation.unpack(@cache, self.unpack(data))}, ) self.register_type(0x02, Symbol) end |