Sha256: 70cf7cf4815b2c2ff2dd05bd021c3a1969cd08e4ca2fb5cfbb6ac6a2e54ec8a1

Contents?: true

Size: 424 Bytes

Versions: 5

Compression:

Stored size: 424 Bytes

Contents

require 'ffi-glib/list_methods'

module GLib
  load_class :List

  # Overrides for GList, GLib's doubly linked list implementation.
  class List
    include ListMethods

    def self.from_enumerable type, arr
      arr.inject(self.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.4 lib/ffi-glib/list.rb
gir_ffi-0.7.3 lib/ffi-glib/list.rb
gir_ffi-0.7.2 lib/ffi-glib/list.rb
gir_ffi-0.7.1 lib/ffi-glib/list.rb
gir_ffi-0.7.0 lib/ffi-glib/list.rb