Skip to content

Commit

Permalink
Changes twigil to public
Browse files Browse the repository at this point in the history
There is no reason in this example to show a private attribute.

This clarifies that TWEAK can use $! to access attributes and
that it's not a typo, without going into an explanation at
this stage.
  • Loading branch information
MorayJ committed Dec 3, 2020
1 parent 6161763 commit a88a225
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/Language/rb-nutshell.pod6
Expand Up @@ -967,9 +967,9 @@ p = Person.new( name: 'Jack', age: 23 )
class Person {
has $.name = 'Jill';
has $.age = 42;
has $!birth_year;
has $.birth_year;
method TWEAK {
$!birth_year = now.Date.year - $.age;
$!birth_year = now.Date.year - $!age;
}
}
my $p = Person.new( name => 'Jack', age => 23 )
Expand Down

0 comments on commit a88a225

Please sign in to comment.