Skip to content

Commit

Permalink
- Use delegation as suggested by @lizmat.
Browse files Browse the repository at this point in the history
  • Loading branch information
Xliff committed Jul 10, 2024
1 parent 91adbb9 commit a51c9dc
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions lib/Cro/Message.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,7 @@ role Cro::Message {
# cw: For OOB attributes associated with the messages. Consider
# that there is no way to know who the message is from,
# or where it is supposed to go.
has %!attributes;

method keys { %!attributes.keys }
method pairs { %!attributes.pairs }
method values { %!attributes.values }

method AT-KEY (\k) is rw {
%!attributes{k}
}

method EXISTS-key (\k) {
%!attributes{k}:exists;
}
has %!attributes handles <keys pairs values AT-KEY EXISTS-KEY>;


# Provides trace output for use with CRO_TRACE=1 and `cro trace ...`.
Expand Down

0 comments on commit a51c9dc

Please sign in to comment.