Module: GirFFI::EnumBase
- Defined in:
- lib/gir_ffi/enum_base.rb
Instance Method Summary collapse
- #[](arg) ⇒ Object
- #gir_ffi_builder ⇒ Object
- #setup_and_call(method, *arguments, &block) ⇒ Object
- #setup_method(name) ⇒ Object
Instance Method Details
#[](arg) ⇒ Object
3 4 5 |
# File 'lib/gir_ffi/enum_base.rb', line 3 def [](arg) self::Enum[arg] end |
#gir_ffi_builder ⇒ Object
17 18 19 |
# File 'lib/gir_ffi/enum_base.rb', line 17 def gir_ffi_builder self.const_get :GIR_FFI_BUILDER end |
#setup_and_call(method, *arguments, &block) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/gir_ffi/enum_base.rb', line 7 def setup_and_call method, *arguments, &block result = setup_method method.to_s unless result raise RuntimeError, "Unable to set up method #{method} in #{self}" end self.send method, *arguments, &block end |
#setup_method(name) ⇒ Object
21 22 23 |
# File 'lib/gir_ffi/enum_base.rb', line 21 def setup_method name gir_ffi_builder.setup_method name end |