Sha256: ebeb06f99da8cf75eb9714f9a4ca52b038afef92d28d2abfdfbd6f9e1d3eda06
Contents?: true
Size: 425 Bytes
Versions: 44
Compression:
Stored size: 425 Bytes
Contents
# Demonstration program for FFI functionality. # # Show what happens if we call layout again in a subclass. This works in # JRuby, but not in MRI (gives warnings with ffi 0.6.3, is explicitely # forbidden later). # require 'ffi' class Foo < FFI::Struct layout :a, :int, :b, :int end class Bar < Foo layout :p, Foo, :c, :int end bar = Bar.new foo = Foo.new(bar.to_ptr) foo[:a] = 20 puts "bar[:p][:a] = #{bar[:p][:a]}"
Version data entries
44 entries across 44 versions & 1 rubygems