Skip to content

Commit 0e6c0cd

Browse files
author
Jan-Olof Hendig
committed
Added docs for Pair.Str
1 parent 8616126 commit 0e6c0cd

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

doc/Type/Pair.pod

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,4 +146,20 @@ Makes the I<value> of the C<Pair> read-only, by removing it from its L<Scalar co
146146
$p.freeze.say; # orange
147147
$p.value = "a new apple"; # Fails with 'Cannot modify an immutable Str'
148148
149+
=head2 method Str
150+
151+
Defined as:
152+
153+
multi method Str(Pair:D:) returns Str:D
154+
155+
Usage:
156+
157+
Pair.Str
158+
159+
Returns a string representation of the invocant formatted
160+
as I<key ~ \t ~ value>.
161+
162+
my $b = eggs => 3;
163+
say $b.Str; # eggs 3
164+
149165
=end pod

0 commit comments

Comments
 (0)