Inherits

Object

Includes

  • Enumerable

Methods

self.

new

(*values)

Constructs a tuple with given values

each

{|value| … }

Iterates over all values of the tuple

Yield Parameters:
Name Type Details
value Object current value

[]

(i)

Returns value of the tuple at position i

Parameters:
Name Type Details
i Integer numeric index of the value inside the tuple, must be 0 < i < tuple.size
Returns:
Type Details
Object value of the tuple at position i

fetch

(i)

Returns value of the tuple at position i

Parameters:
Name Type Details
i Integer numeric index of the value inside the tuple, must be 0 < i < tuple.size
Returns:
Type Details
Object value of the tuple at position i
Raises:
Type Details
IndexError when index is outside of tuple bounds

[]=

(i, value)

Returns value of the tuple at position i

Parameters:
Name Type Details
i Integer numeric index of the value inside the tuple, must be 0 < i < tuple.size
value Object a value to assign at position i
Returns:
Type Details
Object value of the tuple at position i
Raises:
Type Details
IndexError when index is outside of tuple bounds

size

Returns tuple size

Returns:
Type Details
Integer tuple size

to_s

String representation of the tuple

inspect

eql?

(other) aliased as: ==
Returns:
Type Details
Boolean