Class: TurboTest::Wrapper

Inherits:
MessagePack::Factory
  • Object
show all
Defined in:
lib/turbo_test/server.rb

Instance Method Summary collapse

Constructor Details

#initializeWrapper

Returns a new instance of Wrapper.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/turbo_test/server.rb', line 17

def initialize
	super()
	
	# self.register_type(0x00, Object, packer: @bus.method(:temporary), unpacker: @bus.method(:[]))
	
	self.register_type(0x01, Symbol)
	self.register_type(0x02, Exception,
		packer: ->(exception){Marshal.dump(exception)},
		unpacker: ->(data){Marshal.load(data)},
	)
	
	self.register_type(0x03, Class,
		packer: ->(klass){Marshal.dump(klass)},
		unpacker: ->(data){Marshal.load(data)},
	)
end