Method: CTypes::Struct.new
- Defined in:
- lib/ctypes/struct.rb
.new(fields = nil) ⇒ Struct
allocate an instance of the Struct and initialize default values
384 385 386 387 |
# File 'lib/ctypes/struct.rb', line 384 def self.new(fields = nil) buf = fields.nil? ? ("\0" * size) : pack(fields) unpack(buf) end |