Class: FFI::MsgPack::MsgArray
- Inherits:
-
Struct
- Object
- Struct
- FFI::MsgPack::MsgArray
- Defined in:
- lib/ffi/msgpack/msg_array.rb
Instance Method Summary collapse
-
#length ⇒ Integer
The length of the MsgPack Array.
-
#to_a ⇒ Array<Object>
The Array of values.
Instance Method Details
#length ⇒ Integer
The length of the MsgPack Array.
17 18 19 |
# File 'lib/ffi/msgpack/msg_array.rb', line 17 def length self[:size] end |
#to_a ⇒ Array<Object>
The Array of values.
27 28 29 30 31 |
# 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 |