Class: GnomeKeyring::AttributeList

Inherits:
GLib::Array
  • Object
show all
Defined in:
lib/gir_ffi-gnome_keyring/attribute_list.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from(it) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/gir_ffi-gnome_keyring/attribute_list.rb', line 14

def self.from it
  case it
  when self then it
  when FFI::Pointer then wrap it
  else self.new.tap {|arr| arr.append_vals it }
  end
end

.newObject



5
6
7
8
# File 'lib/gir_ffi-gnome_keyring/attribute_list.rb', line 5

def self.new
  ptr = GnomeKeyring::Lib.gnome_keyring_attribute_list_new
  wrap(ptr)
end

.wrap(ptr) ⇒ Object



10
11
12
# File 'lib/gir_ffi-gnome_keyring/attribute_list.rb', line 10

def self.wrap ptr
  super GnomeKeyring::Attribute, ptr
end

Instance Method Details

#append_string(name, value) ⇒ Object



22
23
24
25
26
# File 'lib/gir_ffi-gnome_keyring/attribute_list.rb', line 22

def append_string name, value
  _v2 = GirFFI::InPointer.from(:utf8, name)
  _v3 = GirFFI::InPointer.from(:utf8, value)
  GnomeKeyring::Lib.gnome_keyring_attribute_list_append_string self, _v2, _v3
end

#append_uint32(name, value) ⇒ Object



28
29
30
31
# File 'lib/gir_ffi-gnome_keyring/attribute_list.rb', line 28

def append_uint32 name, value
  _v2 = GirFFI::InPointer.from(:utf8, name)
  GnomeKeyring::Lib.gnome_keyring_attribute_list_append_uint32 self, _v2, value
end