A tuple literal.
Its macro methods are nearly the same as ArrayLiteral.
Instance methods
*(other : NumberLiteral) : TupleLiteral
Source+(other : TupleLiteral) : TupleLiteral
Source-(other : TupleLiteral) : TupleLiteral
Source<<(value : ASTNode) : TupleLiteral
Source[](start : NumberLiteral, count : NumberLiteral) : TupleLiteral | NilLiteral
Similar to Array#[]?(Int, Int), but returns another TupleLiteral
instead of an ArrayLiteral.
Source[](index : NumberLiteral) : ASTNode
Similar to Tuple#[]?(Int).
Source[](index : RangeLiteral) : TupleLiteral | NilLiteral
Similar to Tuple#[]?(Range).
Source[]=(index : NumberLiteral, value : ASTNode) : ASTNode
Sourceall?
Similar to Enumerable#all?
Sourceany?
Similar to Enumerable#any?
Sourceeach_with_index
Similar to Enumerable#each_with_index
Sourcefind
Similar to Enumerable#find
Sourcefirst
Similar to Tuple#first, but returns a NilLiteral if the tuple is empty.
Sourceincludes?(node : ASTNode) : BoolLiteral
Similar to Enumerable#includes?(obj).
Sourcejoin(separator) : StringLiteral
Similar to Enumerable#join
Sourcelast
Similar to Tuple#last, but returns a NilLiteral if the tuple is empty.
Sourcemap
Similar to Enumerable#map
Sourcemap_with_index
Similar to Enumerable#map_with_index
Sourcepush(value : ASTNode) : TupleLiteral
Sourcereduce(memo : ASTNode, &) : ASTNode
Similar to Enumerable#reduce
Sourcereduce
Similar to Enumerable#reduce
Sourcereject
Similar to Enumerable#reject
Sourceselect
Similar to Enumerable#select
Sourcesplat(trailing_string : StringLiteral = nil) : MacroId
Returns a MacroId with all of this tuple's elements joined
by commas.
If trailing_string is given, it will be appended to
the result unless this tuple is empty. This lets you
splat a tuple and optionally write a trailing comma
if needed.
Sourceunshift(value : ASTNode) : TupleLiteral
Similar to Array#unshift.
Source