Module: GLib::ListMethods::ClassMethods

Defined in:
lib/ffi-glib/list_methods.rb

Overview

Common class methods for List and SList

Instance Method Summary collapse

Instance Method Details

#from_enumerable(type, arr) ⇒ Object



80
81
82
# File 'lib/ffi-glib/list_methods.rb', line 80

def from_enumerable(type, arr)
  arr.reduce(new(type)) { |lst, val| lst.prepend val }.reverse
end