Class: GLib::Variant

Inherits:
Object
  • Object
show all
Defined in:
lib/ffi-glib/variant.rb

Overview

Overrides for GVariant, GLib’s variant data type.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.wrap_copy(val) ⇒ Object

For variants, wrap_copy does not do any copying.



29
30
31
# File 'lib/ffi-glib/variant.rb', line 29

def self.wrap_copy(val)
  wrap(val)
end

Instance Method Details

#get_string_with_overrideObject Also known as: get_string



9
10
11
# File 'lib/ffi-glib/variant.rb', line 9

def get_string_with_override
  get_string_without_override.first
end

#store_pointer(ptr) ⇒ Object

Initializing method used in constructors. For Variant, this needs to sink the variant’s floating reference.

NOTE: This is very hard to test since it is not possible to get the variant’s ref count directely. However, there is an error when running the tests on 32-bit systems.



23
24
25
26
# File 'lib/ffi-glib/variant.rb', line 23

def store_pointer(ptr)
  Lib.g_variant_ref_sink ptr
  super
end