Documentation for method required
assembled from the following pages:
Class: Attribute §
From Attribute
(Attribute) method required §
Defined as:
method required(Attribute: --> Any)
Returns 1
for attributes that have the "is required" trait applied, or Mu
if the attribute did not have that trait applied. If the "is required" trait is applied with a string, then that string will be returned instead of 1
.
my = Library.^attributes(:local)[0];my = Library.^attributes(:local)[1];say .required; # OUTPUT: «1» say .readonly; # OUTPUT: «"we always need more books"»