blib/lib/XML/NewsML_G2/Product.pm

filter: Statementstmt 100% 16 / 16 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 100% 19 / 19 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
_build_name
1.0
CRAP 1.0
« blib/lib/XML/NewsML_G2/Picture.pm ↑ Summary blib/lib/XML/NewsML_G2/Provider.pm »
1 package XML::NewsML_G2::Product;
2  
3 19 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 19 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 19 has 'name', isa => 'Str', is => 'ro', lazy => 1, builder => '_build_name';
7 19 has 'isbn', isa => 'Str', is => 'rw';
8 19 has 'ean', isa => 'Str', is => 'rw';
9 19 has 'name_template', isa => 'Str', is => 'ro', default => 'Product %d';
10  
11 {
12 19 my $product_count = 0;
13  
14 sub _build_name {
15 2 ▶ my $self = shift;
Subroutine _build_name: called CC=1 SCAR=0.0
16 2 return sprintf $self->name_template, ++$product_count;
17 }
18 }
19  
20 19 __PACKAGE__->meta->make_immutable;
21  
22 19 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.
« blib/lib/XML/NewsML_G2/Picture.pm ↑ Summary blib/lib/XML/NewsML_G2/Provider.pm »