Class: GLib::Boolean
- Inherits:
-
Object
- Object
- GLib::Boolean
- Extended by:
- FFI::DataConverter
- Defined in:
- lib/gir_ffi-base/glib/boolean.rb
Overview
Implementation of gboolean
Class Method Summary collapse
- .copy_value_to_pointer(value, pointer) ⇒ Object
- .from_native(value, _context) ⇒ Object
- .get_value_from_pointer(pointer) ⇒ Object
- .size ⇒ Object
- .to_native(value, _context) ⇒ Object
Class Method Details
.copy_value_to_pointer(value, pointer) ⇒ Object
21 22 23 |
# File 'lib/gir_ffi-base/glib/boolean.rb', line 21 def self.copy_value_to_pointer value, pointer pointer.put_int 0, to_native(value, nil) end |
.from_native(value, _context) ⇒ Object
9 10 11 |
# File 'lib/gir_ffi-base/glib/boolean.rb', line 9 def self.from_native value, _context value != 0 ? true : false end |
.get_value_from_pointer(pointer) ⇒ Object
25 26 27 |
# File 'lib/gir_ffi-base/glib/boolean.rb', line 25 def self.get_value_from_pointer pointer from_native pointer.get_int(0), nil end |
.size ⇒ Object
17 18 19 |
# File 'lib/gir_ffi-base/glib/boolean.rb', line 17 def self.size FFI.type_size FFI::Type::INT end |
.to_native(value, _context) ⇒ Object
13 14 15 |
# File 'lib/gir_ffi-base/glib/boolean.rb', line 13 def self.to_native value, _context value ? 1 : 0 end |