class

Myst::Param

Inherits Myst::Node / Reference / Object

A parameter for a method definition. Parameters can take many forms. The simplest parameter is just a name or a pattern. If the parameter is a name, it may be prefixed by a '*' to indicate a splat argument, or a '&' to indicate a block argument.

Additionally, if the parameter is a name, it may be prefixed with a pattern and a match operator, or suffixed with a type restriction and/or guard clause, as shown in the final form.

pattern | '*' name | '&' name | [ pattern '=:' ] name [ ':' type_path ] [ '|' guard ]

Constructors

new(pattern : Myst::Node | Nil = nil, name : Nil | String = nil, restriction : Myst::Node | Nil = nil, guard : Myst::Node | Nil = nil, splat : Bool = false, block : Bool = false)
Source

Instance methods

==(other : self)

Returns true if this reference is the same as other. Invokes same?.

accept_children(visitor)
Source
block=(block : Bool)
Source
block?
Source
guard
Source
guard=(guard : Node | Nil)
Source
guard?
Source
hash(hasher)

See Object#hash(hasher)

name
Source
name=(name : String | Nil)
Source
name?
Source
pattern
Source
pattern=(pattern : Node | Nil)
Source
pattern?
Source
restriction
Source
restriction=(restriction : Node | Nil)
Source
restriction?
Source
splat=(splat : Bool)
Source
splat?
Source