Class: FFI::StructLayout::Enum
- Inherits:
-
Field
- Object
- Field
- FFI::StructLayout::Enum
- Defined in:
- lib/ffi/struct_layout.rb
Overview
An enum Field in a FFI::StructLayout.
Instance Method Summary collapse
-
#get(ptr) ⇒ Object
Get an object of type #type from memory pointed by
ptr
. -
#put(ptr, value) ⇒ nil
Set
value
into memory pointed byptr
.
Instance Method Details
#get(ptr) ⇒ Object
Get an object of type #type from memory pointed by ptr
.
56 57 58 |
# File 'lib/ffi/struct_layout.rb', line 56 def get(ptr) type.find(ptr.get_int(offset)) end |
#put(ptr, value) ⇒ nil
Set value
into memory pointed by ptr
.
64 65 66 |
# File 'lib/ffi/struct_layout.rb', line 64 def put(ptr, value) ptr.put_int(offset, type.find(value)) end |