]> git.vpit.fr Git - perl/modules/rgit.git/blob - lib/App/Rgit/Guard.pm
Make sure the POD headings are linkable
[perl/modules/rgit.git] / lib / App / Rgit / Guard.pm
1 package App::Rgit::Guard;
2
3 use strict;
4 use warnings;
5
6 =head1 NAME
7
8 App::Rgit::Guard - Scope guard helper for App::Rgit.
9
10 =head1 VERSION
11
12 Version 0.08
13
14 =cut
15
16 our $VERSION = '0.08';
17
18 =head1 DESCRIPTION
19
20 This class implements a simple scope guard object.
21
22 This is an internal module to L<rgit>.
23
24 =head1 METHODS
25
26 =head2 C<new>
27
28     my $guard = App::Rgit::Guard->new($callback);
29
30 Creates a new C<App::Rgit::Guard> object that will call C<$callback> when it is destroyed.
31
32 =cut
33
34 sub new {
35  my $class = shift;
36  $class = ref $class || $class;
37
38  bless \($_[0]), $class;
39 }
40
41 =head2 C<DESTROY>
42
43 Invokes the callback when the guard object goes out of scope.
44
45 =cut
46
47 sub DESTROY { ${$_[0]}->() }
48
49 =head1 SEE ALSO
50
51 L<rgit>.
52
53 =head1 AUTHOR
54
55 Vincent Pit, C<< <perl at profvince.com> >>, L<http://profvince.com>.
56
57 You can contact me by mail or on C<irc.perl.org> (vincent).
58
59 =head1 BUGS
60
61 Please report any bugs or feature requests to C<bug-rgit at rt.cpan.org>, or through the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=rgit>.
62 I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
63
64 =head1 SUPPORT
65
66 You can find documentation for this module with the perldoc command.
67
68     perldoc App::Rgit::Guard
69
70 =head1 COPYRIGHT & LICENSE
71
72 Copyright 2008,2009,2010 Vincent Pit, all rights reserved.
73
74 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
75
76 =cut
77
78 1; # End of App::Rgit::Guard