submethod BUILD
1 | language documentation Type system |
1.1 | (Type system) submethod BUILD |
Documentation for submethod BUILD
assembled from the following types:
language documentation Type system
From Type system
(Type system) submethod BUILD
The submethod BUILD
is (indirectly) called by .bless. It is meant to set private and public attributes of a class and receives all names attributes passed into .bless
. The default constructor .new defined in Mu
is the method that invokes it. Given that public accessor methods are not available in BUILD
, you must use private attribute notation instead.
;C.new.say; C.new('answer').say;# OUTPUT: «C.new(attr => 42)# C.new(attr => "answer")»