Skip to content

class Crystal::Splat
inherits Crystal::UnaryExpression

Class methods

.at

Yields arg, arg_index, object, object_index corresponding to arguments at a def's splat index, matching the given objects. If there are more objects than arguments in the method, they are not yielded. If splat index is nil, all args and objects (with their indices) are yielded.

View source

.before

Yields arg, arg_index, object, object_index corresponding to arguments before a def's splat index, matching the given objects. If there are more objects than arguments in the method, they are not yielded. If splat index is nil, all args and objects (with their indices) are yielded.

View source

.match

Yields arg, arg_index, object, object_index corresponding to def arguments matching the given objects, taking into account the def's splat index.

View source

.size(a_def, objects, splat_index = a_def.splat_index)

Returns the splat size of this def matching the given objects.

View source

Methods

#clone_without_location

View source

#interpret(method : String, args : Array(ASTNode), named_args : Hash(String, ASTNode)?, block : Crystal::Block?, interpreter : Crystal::MacroInterpreter, name_loc : Location?)

View source