File Coverage

blib/lib/Games/AssaultCube/Log/Line/MasterserverReply.pm
Criterion Covered Total %
statement 1 3 33.3
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 2 4 50.0


line stmt bran cond sub pod time code
1             # Declare our package
2             package Games::AssaultCube::Log::Line::MasterserverReply;
3              
4             # import the Moose stuff
5 1     1   2784 use Moose;
  0            
  0            
6              
7             # Initialize our version
8             use vars qw( $VERSION );
9             $VERSION = '0.04';
10              
11             extends 'Games::AssaultCube::Log::Line::Base';
12              
13             # TODO improve validation for everything here, ha!
14              
15             has 'reply' => (
16             isa => 'Str',
17             is => 'ro',
18             required => 1,
19             );
20              
21             has 'success' => (
22             isa => 'Bool',
23             is => 'ro',
24             required => 1,
25             );
26              
27             has 'tostr' => (
28             isa => 'Str',
29             is => 'ro',
30             lazy => 1,
31             default => sub {
32             my $self = shift;
33             return "Masterserver reply(" . ( $self->success ? "OK" : "FAIL" ) . "): " . $self->reply;
34             },
35             );
36              
37             no Moose;
38             __PACKAGE__->meta->make_immutable;
39              
40             1;
41             __END__
42              
43             =for stopwords masterserver
44             =head1 NAME
45              
46             Games::AssaultCube::Log::Line::MasterserverReply - Describes the MasterserverReply event in a log line
47              
48             =head1 ABSTRACT
49              
50             Describes the MasterserverReply event in a log line
51              
52             =head1 DESCRIPTION
53              
54             This module holds the "MasterserverReply" event data from a log line. Normally, you would not use this class directly
55             but via the L<Games::AssaultCube::Log::Line> class.
56              
57             This line is emitted when the AC server receives a reply from the masterserver.
58              
59             =head2 Attributes
60              
61             Those attributes hold information about the event. As this class extends the L<Games::AssaultCube::Log::Line::Base>
62             class, you can also use it's attributes too.
63              
64             =head3 reply
65              
66             The text of the reply from the masterserver
67              
68             =head3 success
69              
70             A boolean value indicating if the request was successful or not
71              
72             NOTE: We don't know every possible reply, so it assumes success for the ones we can't parse!
73              
74             =head1 AUTHOR
75              
76             Apocalypse E<lt>apocal@cpan.orgE<gt>
77              
78             Props goes to the BS clan for the support!
79              
80             This project is sponsored by L<http://cubestats.net>
81              
82             =head1 COPYRIGHT AND LICENSE
83              
84             Copyright 2009 by Apocalypse
85              
86             This library is free software; you can redistribute it and/or modify
87             it under the same terms as Perl itself.
88              
89             =cut