line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package KiokuX::Model::Role::Annotations::Annotation; |
2
|
1
|
|
|
1
|
|
6914
|
use Moose::Role; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
use namespace::clean; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
with qw(KiokuX::Model::Role::Annotations::Annotation::API); |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
has subject => ( |
9
|
|
|
|
|
|
|
isa => "Str|Object", |
10
|
|
|
|
|
|
|
reader => "_subject", |
11
|
|
|
|
|
|
|
required => 1, |
12
|
|
|
|
|
|
|
); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub subject { shift->_subject } # fucking role attributes |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# ex: set sw=4 et: |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
__PACKAGE__ |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
__END__ |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=pod |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 NAME |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
KiokuX::Model::Role::Annotations::Annotation - a role for annotation objects |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 SYNOPSIS |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
package MyAnnotation; |
31
|
|
|
|
|
|
|
use Moose; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
with qw(KiokuX::Model::Role::Annotations::Annotation); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# to create an annotation: |
38
|
|
|
|
|
|
|
MyAnnotation->new( subject => $object ); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 DESCRIPTION |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
This role implements the abstract |
43
|
|
|
|
|
|
|
L<KiokuX::Model::Role::Annotations::Annotation::API> role (which requires just |
44
|
|
|
|
|
|
|
a C<subject> method to return the key object), using an attribute. |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=over 4 |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=item subject |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
A string or an object. |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Required. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=back |
57
|
|
|
|
|
|
|
|