123456789_123456789_123456789_123456789_123456789_

Class: FFI::StructLayout::Enum

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Field
Instance Chain:
self, Field
Inherits: FFI::StructLayout::Field
Defined in: lib/ffi/struct_layout.rb

Overview

An enum Field in a ::FFI::StructLayout.

Class Method Summary

Field - Inherited

Instance Method Summary

Field - Inherited

Constructor Details

This class inherits a constructor from FFI::StructLayout::Field

Instance Method Details

#get(ptr) ⇒ Object

Get an object of type #type from memory pointed by ptr.

Parameters:

[ GitHub ]

  
# 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.

Parameters:

[ GitHub ]

  
# File 'lib/ffi/struct_layout.rb', line 64

def put(ptr, value)
  ptr.put_int(offset, type.find(value))
end