Module: GirFFI::ModuleBase
- Defined in:
- lib/gir_ffi/module_base.rb
Overview
Base module for modules representing GLib namespaces.
Instance Method Summary collapse
- #const_missing(classname) ⇒ Object
- #gir_ffi_builder ⇒ Object
- #method_missing(method, *arguments, &block) ⇒ Object
-
#setup_class(classname) ⇒ Object
(also: #load_class)
deprecated
Deprecated.
The load_class method should always be used. Remove in 0.8.0
- #setup_method(name) ⇒ Object
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *arguments, &block) ⇒ Object
4 5 6 7 8 |
# File 'lib/gir_ffi/module_base.rb', line 4 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
10 11 12 |
# File 'lib/gir_ffi/module_base.rb', line 10 def const_missing classname load_class(classname) end |
#gir_ffi_builder ⇒ Object
21 22 23 |
# File 'lib/gir_ffi/module_base.rb', line 21 def gir_ffi_builder self::GIR_FFI_BUILDER end |
#setup_class(classname) ⇒ Object Also known as: load_class
Deprecated.
The load_class method should always be used. Remove in 0.8.0
15 16 17 |
# File 'lib/gir_ffi/module_base.rb', line 15 def setup_class classname gir_ffi_builder.build_namespaced_class classname.to_s end |
#setup_method(name) ⇒ Object
25 26 27 |
# File 'lib/gir_ffi/module_base.rb', line 25 def setup_method name gir_ffi_builder.setup_method name end |