File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -945,7 +945,7 @@ class Person {
945
945
Creating a new instance of the class uses the C < .new > method. In Ruby you must
946
946
manually assign instance variables as needed inside C < initialize > . In Raku
947
947
you get a default constructor that accepts key/value pairs of accessor
948
- attributes, and can do further setup in the C < BUILD > method. Like with Ruby,
948
+ attributes, and can do further setup in the C < TWEAK > method. Like with Ruby,
949
949
you can override C < new > itself for more advanced functionality, but this is
950
950
rare.
951
951
@@ -968,7 +968,7 @@ class Person {
968
968
has $.name = 'Jill';
969
969
has $.age = 42;
970
970
has $!birth_year;
971
- method BUILD {
971
+ method TWEAK {
972
972
$!birth_year = now.Date.year - $.age;
973
973
}
974
974
}
You can’t perform that action at this time.
0 commit comments