File Coverage

blib/lib/Games/AssaultCube/Log/Line/Base.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::Base;
3              
4             # import the Moose stuff
5 1     1   2460 use Moose;
  0            
  0            
6             use MooseX::StrictConstructor;
7              
8             # Initialize our version
9             use vars qw( $VERSION );
10             $VERSION = '0.04';
11              
12             # TODO improve validation for everything here, ha!
13              
14             has 'line' => (
15             isa => 'Str',
16             is => 'ro',
17             required => 1,
18             );
19              
20             has 'event' => (
21             isa => 'Str',
22             is => 'ro',
23             required => 1,
24             );
25              
26             has 'tostr' => (
27             isa => 'Str',
28             is => 'ro',
29             lazy => 1,
30             default => sub {
31             my $self = shift;
32             return $self->line;
33             },
34             );
35              
36             no Moose;
37             __PACKAGE__->meta->make_immutable;
38              
39             1;
40             __END__
41              
42             =for stopwords tostr
43              
44             =head1 NAME
45              
46             Games::AssaultCube::Log::Line::Base - The base log line object
47              
48             =head1 ABSTRACT
49              
50             This module provides the base log line descriptions all other subclasses inherit from.
51              
52             =head1 DESCRIPTION
53              
54             This module provides the base log line descriptions all other subclasses inherit from.
55              
56             =head2 Attributes
57              
58             Those attributes are the "generic" ones you can access. Please see the subclasses for additional attributes
59             you can use.
60              
61             =head3 line
62              
63             The raw log line
64              
65             =head3 event
66              
67             The event specified by the line ( see subclasses for all possible event types )
68              
69             =head3 tostr
70              
71             A convenience attribute returning a nice string representing this event ( might differ from the line! )
72              
73             =head1 AUTHOR
74              
75             Apocalypse E<lt>apocal@cpan.orgE<gt>
76              
77             Props goes to the BS clan for the support!
78              
79             This project is sponsored by L<http://cubestats.net>
80              
81             =head1 COPYRIGHT AND LICENSE
82              
83             Copyright 2009 by Apocalypse
84              
85             This library is free software; you can redistribute it and/or modify
86             it under the same terms as Perl itself.
87              
88             =cut