module GirFFI::InterfaceBase

Base module for modules representing GLib interfaces.

Public Instance Methods

setup_and_call(method, arguments, &block) click to toggle source
# File lib/gir_ffi/interface_base.rb, line 14
def setup_and_call(method, arguments, &block)
  method_name = setup_method method.to_s
  raise NoMethodError, "undefined method `#{method}' for #{self}" unless method_name

  send method_name, *arguments, &block
end
to_callback_ffi_type() click to toggle source
# File lib/gir_ffi/interface_base.rb, line 29
def to_callback_ffi_type
  :pointer
end
to_ffi_type() click to toggle source
# File lib/gir_ffi/interface_base.rb, line 25
def to_ffi_type
  :pointer
end
wrap(ptr) click to toggle source
# File lib/gir_ffi/interface_base.rb, line 21
def wrap(ptr)
  ptr.to_object
end