Class: FFI::StructLayout
- Inherits:
-
Object
- Object
- FFI::StructLayout
- Defined in:
- lib/ffi/struct_layout.rb
Defined Under Namespace
Classes: Enum, InnerStruct, Mapped
Instance Method Summary collapse
-
#offset_of(field_name) ⇒ Integer
Get the offset of a field.
-
#offsets ⇒ Array<Array(Symbol, Integer)>
Get an array of tuples (field name, offset of the field).
Instance Method Details
#offset_of(field_name) ⇒ Integer
Get the offset of a field.
46 47 48 |
# File 'lib/ffi/struct_layout.rb', line 46 def offset_of(field_name) self[field_name].offset end |
#offsets ⇒ Array<Array(Symbol, Integer)>
Get an array of tuples (field name, offset of the field).
40 41 42 |
# File 'lib/ffi/struct_layout.rb', line 40 def offsets members.map { |m| [ m, self[m].offset ] } end |