lib/libvirt-ruby/connect.rb in libvirt-ruby-0.0.1 vs lib/libvirt-ruby/connect.rb in libvirt-ruby-0.0.2
- old
+ new
@@ -1,11 +1,18 @@
module Libvirt
module Ruby
module Connect
- def self.dispatcher(method, args = [])
- return_type = args.delete(args.last)
- attach_function ("virConnect" + method.to_s), ("virConnect" + method.to_s), args, return_type
- send(("virConnect" + method.to_s), args)
+ extend Libvirt::Ruby::Util
+ extend FFI::Library
+
+ begin
+ ffi_lib "libvirt.so.0"
+ rescue LoadError
+ raise Libvirt::Ruby::Exceptions::MissingLib
+ end
+
+ def self.klass
+ "virConnect"
end
end
end
end
\ No newline at end of file