class FFI::StructGenerator::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/ffi/tools/struct_generator.rb, line 172 def initialize(name, type) @name = name @type = type @offset = nil @size = nil end
Public Instance Methods
offset=(o)
click to toggle source
# File lib/ffi/tools/struct_generator.rb, line 179 def offset=(o) @offset = o end
to_config(name)
click to toggle source
# File lib/ffi/tools/struct_generator.rb, line 183 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