Module: GirFFI::InterfaceBase

Includes:
InstanceMethodSetup, MethodSetup, RegisteredTypeBase
Defined in:
lib/gir_ffi/interface_base.rb

Overview

Base module for modules representing GLib interfaces.

Instance Method Summary collapse

Methods included from InstanceMethodSetup

#setup_instance_method, #setup_instance_method!

Methods included from MethodSetup

#setup_method, #setup_method!

Methods included from RegisteredTypeBase

#gtype

Methods included from TypeBase

#gir_ffi_builder, #gir_info

Instance Method Details

#setup_and_call(method, arguments, &block) ⇒ Object

Raises:

  • (NoMethodError)


14
15
16
17
18
# 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_ffi_typeObject



24
25
26
# File 'lib/gir_ffi/interface_base.rb', line 24

def to_ffi_type
  :pointer
end

#wrap(ptr) ⇒ Object



20
21
22
# File 'lib/gir_ffi/interface_base.rb', line 20

def wrap(ptr)
  ptr.to_object
end