Parse::Method::Signatures::Param(3pm)

Parse::Method::Signatures::Param3pm

A parsed parameter from a signature

Attributes

All attributes of this class are read-only.

required

Is this parameter required (true) or optional (false)?

sigil

The effective sigil ('$', '@' or '%') of this parameter.

type_constraints

Type: Parse::Method::Signatures::TypeConstraint

Predicate: has_type_constraints

Representation of the type constraint for this parameter. Most commonly you will just call "meta_type_constraint" and not access this attribute directly.

default_value

Type: Str

Predicate: has_default_value

A string that should be eval'd or injected to get the default value for this parameter. For example:

 $name = 'bar'

Would give a default_value of "'bar'".

constraints

Type: ArrayRef[Str]

Predicate: has_constraints

"where" constraints for this type. Each member of the array a the string (including enclosing braces) of the where constraint block.

param_traits

Type: ArrayRef[ Tupple[Str,Str] ]

Predicate: has_traits

Traits that this parameter is declared to have. For instance

 $foo does coerce

would have a trait of

 ['does', 'coerce']

Methods

to_string

meta_type_constraint

Get the Moose::Meta::TypeConstraint for this parameter. Check first that the type has a type constraint:

 $tc = $param->meta_type_constraint if $param->has_type_constraints;

Releases

8 releases since Debian 6.0 (Squeeze); the text changed 5 times.

  1. 6.0
  2. 7
  3. 8
  4. 9
  5. 10–11
  6. 12–13

Authors

Ash Berlin <[email protected]>.

Florian Ragwitz <[email protected]>.

License

Licensed under the same terms as Perl itself.

From libparse-method-signatures-perl 1.003019-2 in Debian 13 (Trixie). Parsed by carta from the page's man source.