Class: GLib::List
Overview
Overrides for GList, GLib’s doubly linked list implementation.
Instance Attribute Summary
Attributes included from ListMethods
Class Method Summary collapse
Instance Method Summary collapse
Methods included from ListMethods
#each, #head, included, replace_method, #reset_typespec, #tail
Class Method Details
.from_enumerable(type, arr) ⇒ Object
22 23 24 25 |
# File 'lib/ffi-glib/list.rb', line 22 def self.from_enumerable type, arr arr.inject(self.new type) { |lst, val| lst.append val } end |
.new(type) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/ffi-glib/list.rb', line 14 def self.new type _real_new.tap do |it| struct = ffi_structure.new(FFI::Pointer.new(0)) it.instance_variable_set :@struct, struct it.element_type = type end end |