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) #

[View source]

Instance Method Detail

def [](n : Int32) : T #

[View source]
def []?(n : Int32) : T | Nil #

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

Must yield this collection's elements to the block.


[View source]
def finalize #

[View source]
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

[View source]
def first? : T | Nil #
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

[View source]
def last : T #

[View source]
def last? : T | Nil #

[View source]
def size #
Description copied from module Enumerable(T)

Returns the number of elements in the collection.

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

[View source]
def to_unsafe #

[View source]