class FFI::Generators::Structures::Field
A field in a Struct.
Attributes
name[R]
offset[R]
size[RW]
type[R]
Public Class Methods
new(name, type)
click to toggle source
# File lib/ffi2/generators/structures.rb, line 44 def initialize(name, type) @name = name @type = type @offset = nil @size = nil end
Public Instance Methods
offset=(o)
click to toggle source
# File lib/ffi2/generators/structures.rb, line 51 def offset=(o) @offset = o end
to_config(name)
click to toggle source
# File lib/ffi2/generators/structures.rb, line 55 def to_config(name) buf = [] buf << "rbx.platform.#{name}.#{@name}.offset = #{@offset}" buf << "rbx.platform.#{name}.#{@name}.size = #{@size}" buf << "rbx.platform.#{name}.#{@name}.type = #{@type}" if @type buf end