Module: FFI::MsgPack::Packable

Included in:
Array, FalseClass, Float, Hash, Integer, NilClass, String, TrueClass
Defined in:
lib/ffi/msgpack/packable.rb

Instance Method Summary collapse

Instance Method Details

#to_msgpackString

Packs a Ruby Object.

Returns:

  • (String)

    The packed Object.



12
13
14
15
16
17
# File 'lib/ffi/msgpack/packable.rb', line 12

def to_msgpack
  packer = Packer.create
  packer << obj

  return packer.to_s
end