Class

Rinda::Tuple

Inheritance
< Object

A tuple is the elementary object in Rinda programming. Tuples may be matched against templates if the tuple and the template are the same size.

Methods

Class

Visibility Signature
public new (ary_or_hash)

Instance

Visibility Signature
public [] (k)
public each ( {|k, v| ...}
public fetch (k)
public size ()
public value ()

Class Method Detail

new(ary_or_hash)

Creates a new Tuple from ary_or_hash which must be an Array or Hash.

Instance Method Detail

[](k)

Accessor method for elements of the tuple.

each( {|k, v| ...}

Iterate through the tuple, yielding the index or key, and the value, thus ensuring arrays are iterated similarly to hashes.

fetch(k)

Fetches item k from the tuple.

size()

The number of elements in the tuple.

value()

Return the tuple itself