class FFI::MsgPack::MsgArray

Public Instance Methods

length() click to toggle source

The length of the MsgPack Array.

@return [Integer]

The length of the Array.
# File lib/ffi/msgpack/msg_array.rb, line 17
def length
  self[:size]
end
to_a() click to toggle source

The Array of values.

@return [Array<Object>]

The values contained within the Array.
# File lib/ffi/msgpack/msg_array.rb, line 27
def to_a
  (0...self.length).map do |index|
    MsgObject.new(self[:ptr][index * MsgObject.size]).to_ruby
  end
end