line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package XML::NewsML_G2::Product; |
2
|
|
|
|
|
|
|
|
3
|
18
|
|
|
18
|
|
127
|
use Moose; |
|
18
|
|
|
|
|
42
|
|
|
18
|
|
|
|
|
154
|
|
4
|
18
|
|
|
18
|
|
83859
|
use namespace::autoclean; |
|
18
|
|
|
|
|
43
|
|
|
18
|
|
|
|
|
167
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
has 'name', isa => 'Str', is => 'ro', lazy => 1, builder => '_build_name'; |
7
|
|
|
|
|
|
|
has 'isbn', isa => 'Str', is => 'rw'; |
8
|
|
|
|
|
|
|
has 'ean', isa => 'Str', is => 'rw'; |
9
|
|
|
|
|
|
|
has 'name_template', isa => 'Str', is => 'ro', default => 'Product %d'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
{ |
12
|
|
|
|
|
|
|
my $product_count = 0; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub _build_name { |
15
|
11
|
|
|
11
|
|
34
|
my $self = shift; |
16
|
11
|
|
|
|
|
378
|
return sprintf $self->name_template, ++$product_count; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
1; |
23
|
|
|
|
|
|
|
__END__ |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 NAME |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
XML::NewsML_G2::Product - a product that is mentioned in the news item |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 SYNOPSIS |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
my $book = XML::NewsML_G2::Product->new |
32
|
|
|
|
|
|
|
(name => 'Some Book', isbn => '1-2345-6789'); |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=over 4 |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=item name |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=item isbn |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
international standard book number |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=item ean |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
european/international article number |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=back |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 AUTHOR |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Philipp Gortan C<< <philipp.gortan@apa.at> >> |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 LICENCE AND COPYRIGHT |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Copyright (c) 2013-2014, APA-IT. All rights reserved. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
See L<XML::NewsML_G2> for the license. |