lib/ffi/msgpack/msg_object.rb in ffi-msgpack-0.1.0 vs lib/ffi/msgpack/msg_object.rb in ffi-msgpack-0.1.1
- old
+ new
@@ -7,9 +7,23 @@
layout :type, :msgpack_object_type,
:values, MsgObjectUnion
#
+ # Initializes a new Msg Object.
+ #
+ # @param [FFI::Pointer] ptr
+ # An optional pointer to an existing Msg Object.
+ #
+ def initialize(ptr=nil)
+ if ptr
+ super(ptr)
+ else
+ super()
+ end
+ end
+
+ #
# Creates a new `nil` Msg Object.
#
# @param [FFI::Pointer] ptr
# Optional pointer to create the Msg Object at.
#