Skip to content

Commit 74e96d7

Browse files
author
Jan-Olof Hendig
committed
Added docs for Baggy.total
1 parent 36b9299 commit 74e96d7

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

doc/Type/Baggy.pod

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,18 @@ taking the individual elements weight into account.
115115
116116
=head2 method total
117117
118-
=comment TODO
118+
Defined as:
119+
120+
method total(Baggy:D:)
121+
122+
Returns the sum of weights for all elements in the C<Baggy>
123+
object.
124+
125+
my $breakfast = bag <eggs spam spam bacon>;
126+
say $breakfast.total; # 4
127+
128+
my $n = ("a" => 5, "b" => 1, "b" => 2).BagHash;
129+
say $n.total; # 8
119130
120131
=head2 method ACCEPTS
121132

0 commit comments

Comments
 (0)