Module: GirFFI::ModuleBase
- Defined in:
- lib/gir_ffi/module_base.rb
Overview
Base module for modules representing GLib namespaces.
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *arguments, &block) ⇒ Object
5
6
7
8
9
|
# File 'lib/gir_ffi/module_base.rb', line 5
def method_missing(method, *arguments, &block)
result = setup_method method.to_s
return super unless result
send method, *arguments, &block
end
|
Instance Method Details
#const_missing(classname) ⇒ Object
15
16
17
|
# File 'lib/gir_ffi/module_base.rb', line 15
def const_missing(classname)
load_class(classname)
end
|
#gir_ffi_builder ⇒ Object
23
24
25
|
# File 'lib/gir_ffi/module_base.rb', line 23
def gir_ffi_builder
self::GIR_FFI_BUILDER
end
|
#load_class(classname) ⇒ Object
19
20
21
|
# File 'lib/gir_ffi/module_base.rb', line 19
def load_class(classname)
gir_ffi_builder.build_namespaced_class classname.to_s
end
|
#respond_to_missing?(method) ⇒ Boolean
11
12
13
|
# File 'lib/gir_ffi/module_base.rb', line 11
def respond_to_missing?(method, *)
gir_ffi_builder.method_available? method
end
|
#setup_method(name) ⇒ Object
27
28
29
|
# File 'lib/gir_ffi/module_base.rb', line 27
def setup_method(name)
gir_ffi_builder.setup_method name
end
|