class

Spectator::FormalArguments(Args, Splat, DoubleSplat)

Inherits Spectator::AbstractArguments / Reference / Object

Arguments passed into a method.

Args must be a NamedTuple type representing the standard arguments. Splat must be a Tuple type representing the extra positional arguments. DoubleSplat must be a NamedTuple type representing extra keyword arguments.

Constructors

new(args : Args, splat_name : Symbol | Nil, splat : Splat, kwargs : DoubleSplat)

Creates arguments used in a method call.

Source
new(args : Args, kwargs : DoubleSplat)

Creates arguments used in a method call.

Source

Class methods

build(args : NamedTuple, splat_name : Symbol, splat : Tuple, kwargs = NamedTuple.new)

Captures arguments passed to a call.

Source
build(args = NamedTuple.new, kwargs = NamedTuple.new)

Captures arguments passed to a call.

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
splat

Additional positional arguments.

Source
splat_name

Name of the splat argument, if used.

Source
to_s(io : IO) : Nil

Constructs a string representation of the arguments.

Source