Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / File / ChangeNotify / Event.pm
1 package File::ChangeNotify::Event;
2
3 use strict;
4 use warnings;
5
6 our $VERSION = '0.11';
7
8 use Moose;
9 use Moose::Util::TypeConstraints;
10
11 has path => (
12     is       => 'ro',
13     isa      => 'Str',
14     required => 1,
15 );
16
17 has type => (
18     is       => 'ro',
19     isa      => enum( [qw( create modify delete unknown )] ),
20     required => 1,
21 );
22
23 no Moose;
24 no Moose::Util::TypeConstraints;
25
26 __PACKAGE__->meta()->make_immutable();
27
28 1;
29
30 __END__
31
32 =head1 NAME
33
34 File::ChangeNotify::Event - Class for file change events
35
36 =head1 SYNOPSIS
37
38     for my $event ( $watcher->new_events() )
39     {
40         print $event->path(), ' - ', $event->type(), "\n";
41     }
42
43 =head1 DESCRIPTION
44
45 This class provides information about a change to a specific file or
46 directory.
47
48 =head1 METHODS
49
50 =head2 File::ChangeNotify::Event->new(...)
51
52 This method creates a new event. It accepts the following arguments:
53
54 =over 4
55
56 =item * path => $path
57
58 The full path to the file or directory that changed.
59
60 =item * type => $type
61
62 The type of event. This must be one of "create", "modify", "delete", or
63 "unknown".
64
65 =back
66
67 =head2 $event->path()
68
69 Returns the path of the changed file or directory.
70
71 =head2 $event->type()
72
73 Returns the type of event.
74
75 =head1 AUTHOR
76
77 Dave Rolsky, E<lt>autarch@urth.orgE<gt>
78
79 =head1 COPYRIGHT & LICENSE
80
81 Copyright 2009 Dave Rolsky, All Rights Reserved.
82
83 This program is free software; you can redistribute it and/or modify
84 it under the same terms as Perl itself.
85
86 =cut