class

Spectator::Arguments(Args, KWArgs)

Inherits Spectator::AbstractArguments / Reference / Object

Arguments used in a method call.

Can also be used to match arguments. Args must be a Tuple representing the standard arguments. KWArgs must be a NamedTuple type representing extra keyword arguments.

Constructors

new(args : Args, kwargs : KWArgs)

Creates arguments used in a method call.

Source

Class methods

any

Returns unconstrained arguments.

Source
capture(*args, **kwargs)

Friendlier constructor for capturing arguments.

Source
none

Instance of empty arguments.

Source

Instance methods

==(other : AbstractArguments)

Checks if this set of arguments and another are equal.

Source
===(other : Arguments)

Checks if another set of arguments matches this set of arguments.

Source
===(other : FormalArguments)

Checks if another set of arguments matches this set of arguments.

Source
[](index : Int)

Returns the positional argument at the specified index.

Source
[](arg : Symbol)

Returns the specified named argument.

Source
args

Positional arguments.

Source
kwargs

Keyword arguments.

Source
named

Returns all named positional and keyword arguments as a named tuple.

Source
positional

Returns all arguments and splatted arguments as a tuple.

Source
to_s(io : IO) : Nil

Constructs a string representation of the arguments.

Source