Module: Steffi::Igraph

Extended by:
FFI::Library
Defined in:
lib/steffi/ffi.rb,
lib/steffi/error.rb,
lib/steffi/graph.rb,
lib/steffi/create.rb,
lib/steffi/vector.rb,
lib/steffi/metrics.rb,
lib/steffi/communities.rb

Defined Under Namespace

Classes: Error

Constant Summary collapse

ErrorHandler =
Proc.new do |reason, file, line, code|
  raise Error.new "#{strerror code}: #{reason} (#{file}:#{line})"
end

Class Method Summary collapse

Class Method Details

.bind(name, in_t, out_t) ⇒ Object



17
18
19
# File 'lib/steffi/ffi.rb', line 17

def self.bind name, in_t, out_t
  attach_function :"igraph_#{name}", in_t, out_t
end

.method_missing(name, *args, &block) ⇒ Object



21
22
23
24
# File 'lib/steffi/ffi.rb', line 21

def self.method_missing name, *args, &block
  iname = :"igraph_#{name}"
  respond_to?(iname) ? send(iname, *args, &block) : super
end