Module: GirFFI::InterfaceBase

Includes:
RegisteredTypeBase
Defined in:
lib/gir_ffi/interface_base.rb

Overview

Base module for modules representing GLib interfaces.

Instance Method Summary collapse

Methods included from RegisteredTypeBase

#gtype

Methods included from TypeBase

#gir_ffi_builder, #gir_info

Instance Method Details

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



9
10
11
12
13
14
15
# File 'lib/gir_ffi/interface_base.rb', line 9

def setup_and_call(method, arguments, &block)
  method_name = setup_method method.to_s
  unless method_name
    raise NoMethodError, "undefined method `#{method}' for #{self}"
  end
  send method_name, *arguments, &block
end

#setup_instance_method(name) ⇒ Object



17
18
19
# File 'lib/gir_ffi/interface_base.rb', line 17

def setup_instance_method(name)
  gir_ffi_builder.setup_instance_method name
end

#setup_method(name) ⇒ Object



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

def setup_method(name)
  gir_ffi_builder.setup_method name
end

#to_ffi_typeObject



29
30
31
# File 'lib/gir_ffi/interface_base.rb', line 29

def to_ffi_type
  :pointer
end

#wrap(ptr) ⇒ Object



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

def wrap(ptr)
  ptr.to_object
end