Class: WinFFI::FFIStruct

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/win-ffi/core/struct.rb

Direct Known Subclasses

GUID, LUID, OSVERSIONINFOEX, POINT, RECT, SECURITY_ATTRIBUTES, SIZE

Class Method Summary collapse

Class Method Details

.layout(*args) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/win-ffi/core/struct.rb', line 7

def self.layout(*args)
  super
  members.each do |name|
    unless method_defined?(name)
      define_method name, ->{ self[name] }
      define_method "#{name}=", ->(v){ self[name] = v }
    end
  end
end