Sha256: 77ead6a137e100e6db178128884bd58042f3bbe260258366d3884f42268da6a3

Contents?: true

Size: 422 Bytes

Versions: 5

Compression:

Stored size: 422 Bytes

Contents

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

5 entries across 5 versions & 1 rubygems

Version Path
gir_ffi-0.7.10 lib/ffi-glib/list.rb
gir_ffi-0.7.9 lib/ffi-glib/list.rb
gir_ffi-0.7.8 lib/ffi-glib/list.rb
gir_ffi-0.7.7 lib/ffi-glib/list.rb
gir_ffi-0.7.6 lib/ffi-glib/list.rb