Skip to content

Instantly share code, notes, and snippets.

@djberg96
Created December 9, 2011 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djberg96/1451811 to your computer and use it in GitHub Desktop.
Save djberg96/1451811 to your computer and use it in GitHub Desktop.
ffi and private declarations
require 'ffi'
class Foo
class << self
extend FFI::Library
ffi_lib FFI::Library::LIBC
private
attach_function 'puts', [:string], :int
public
def hello
puts "Hello, World!"
end
end
end
p Foo.methods(false) # => why is 'puts' here?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment