Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
doc class WrapHandle
  • Loading branch information
gfldex committed Sep 23, 2016
1 parent 2061fa7 commit 0bce341
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions doc/Type/WrapHandle.pod6
@@ -0,0 +1,23 @@
=TITLE class WrapHandle
=SUBTITLE Holds all information needed to unwrap a wrapped routine.
class WrapHandle { ... }

C<WrapHandle> is created and returned by L<wrap|/type/Routine#method_wrap>. It's only use is to unwrap wrapped routines. Either call L<unwrap|/type/Routine#method_unwrap> on a routine object or call the method C<restore> on a C<WrapHandle> object.

sub f(){ say 'f was called' }
my $wrap-handle = &f.wrap({ say 'before'; callsame; say 'after' })

f;
$wrap-handle.restore;
f;
# OUTPUT«before␤f was called␤after␤f was called␤»

=head1 Methods
=head2 method restore
method restore() returns Bool:D

Unwraps a wrapped routine and returns C<Bool::True> on success.

0 comments on commit 0bce341

Please sign in to comment.