Sha256: d81cf1af0ec8e80103ed814fcf87872aa4800b6018db3947ed514fda26c82123
Contents?: true
Size: 455 Bytes
Versions: 9
Compression:
Stored size: 455 Bytes
Contents
# frozen_string_literal: true require 'ffi-glib/list_methods' GLib.load_class :List module GLib # Overrides for GList, GLib's doubly linked list implementation. class List include ListMethods def self.from_enumerable(type, arr) arr.reduce(new(type)) { |lst, val| lst.append val } end def append(data) self.class.wrap(element_type, Lib.g_list_append(self, element_ptr_for(data))) end end end
Version data entries
9 entries across 9 versions & 1 rubygems