class GLib::List(T)

Included Modules

Defined in:

lib/gi-crystal/src/bindings/g_lib/list.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(list : Pointer(LibGLib::List), transfer : GICrystal::Transfer) #

Instance Method Detail

def [](n : Int32) : T #

def []?(n : Int32) : T? #

def each(&block : T -> _) #
Description copied from module Enumerable(T)

Must yield this collection's elements to the block.


def finalize #

def first : T #
Description copied from module Enumerable(T)

Returns the first element in the collection. Raises Enumerable::EmptyError if the collection is empty.

([1, 2, 3]).first   # => 1
([] of Int32).first # raises Enumerable::EmptyError

def first? : T? #
Description copied from module Enumerable(T)

Returns the first element in the collection. When the collection is empty, returns nil.

([1, 2, 3]).first?   # => 1
([] of Int32).first? # => nil

def last : T #

def last? : T? #

def size #
Description copied from module Enumerable(T)

Returns the number of elements in the collection.

[1, 2, 3, 4].size # => 4

def to_unsafe #