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/Organisation.pm ↑ Summary blib/lib/XML/NewsML_G2/Provider.pm »
1 package XML::NewsML_G2::Product;
2  
3 # $Id: Product.pm 46929 2013-06-25 08:32:49Z apatecgortan $
4  
5 10 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 10 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8  
9 10 has 'name', isa => 'Str', is => 'ro', lazy => 1, builder => '_build_name';
10 10 has 'isbn', isa => 'Str', is => 'rw';
11 10 has 'ean', isa => 'Str', is => 'rw';
12 10 has 'name_template', isa => 'Str', is => 'ro', default => 'Product %d';
13  
14 {
15 10 my $product_count = 0;
16 sub _build_name {
17 2 ▶ my $self = shift;
Subroutine _build_name: called CC=1 SCAR=0.0
18 2 return sprintf $self->name_template, ++$product_count;
19 }
20 }
21  
22 10 __PACKAGE__->meta->make_immutable;
23  
24 10 1;
25 __END__
26  
27 =head1 NAME
28  
29 XML::NewsML_G2::Product - a product that is mentioned in the news item
30  
31 =head1 SYNOPSIS
32  
33 my $book = XML::NewsML_G2::Product->new
34 (name => 'Some Book', isbn => '1-2345-6789');
35  
36 =head1 ATTRIBUTES
37  
38 =over 4
39  
40 =item name
41  
42 =item isbn
43  
44 international standard book number
45  
46 =item ean
47  
48 european/international article number
49  
50 =back
51  
52 =head1 AUTHOR
53  
54 Philipp Gortan C<< <philipp.gortan@apa.at> >>
55  
56 =head1 LICENCE AND COPYRIGHT
57  
58 Copyright (c) 2013, APA-IT. All rights reserved.
59  
60 See L<XML::NewsML_G2> for the license.
« blib/lib/XML/NewsML_G2/Organisation.pm ↑ Summary blib/lib/XML/NewsML_G2/Provider.pm »