We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 774d9bd commit 9793f64Copy full SHA for 9793f64
doc/Language/objects.pod
@@ -180,8 +180,10 @@ destination. To change this you can provide a default value or make
180
sure that it is provided by marking it with L<is required>.
181
182
class Journey {
183
- has $.origin is required; # error if origin is not provided
184
- has $.destination = 'Orlando'; # if not provided set to Orlando
+ # error if origin is not provided
+ has $.origin is required;
185
+ # set the destination to Orlando as default (unless that is the origin!)
186
+ has $.destination = self.origin eq 'Orlando' ?? 'Kampala' !! 'Orlando';
187
has @!travellers;
188
has $.notes is rw;
189
}
0 commit comments