Subject:
[ruby-ffi] Is FFI::Struct.layout meant to be public?
From:
Jeremy Voorhis
Date:
5/19/10 12:42 PM
To:
ruby-ffi@googlegroups.com

Hello,

I'm working on a project where I generate both an FFI::Struct and an LLVM struct from the same description. It's been convenient to create the struct like so:

  klass = Class.new(FFI::Struct)
  klass.layout(...)

This conveniently avoids devising a way to pass data into the scope of the class definition from the enclosing scope, but I'm having a little cognitive dissonance. Should FFI support this usage, or am I abusing the api?

Thanks,

Jeremy