line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Box::Calc::BoxType; |
2
|
|
|
|
|
|
|
$Box::Calc::BoxType::VERSION = '1.0200'; |
3
|
8
|
|
|
8
|
|
754
|
use strict; |
|
8
|
|
|
|
|
13
|
|
|
8
|
|
|
|
|
230
|
|
4
|
8
|
|
|
8
|
|
39
|
use warnings; |
|
8
|
|
|
|
|
15
|
|
|
8
|
|
|
|
|
279
|
|
5
|
8
|
|
|
8
|
|
739
|
use Moose; |
|
8
|
|
|
|
|
444585
|
|
|
8
|
|
|
|
|
44
|
|
6
|
|
|
|
|
|
|
with 'Box::Calc::Role::Container'; |
7
|
|
|
|
|
|
|
with 'Box::Calc::Role::Mailable'; |
8
|
8
|
|
|
8
|
|
46459
|
use Ouch; |
|
8
|
|
|
|
|
1152
|
|
|
8
|
|
|
|
|
1474
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Box::Calc::BoxType - The container class for the types (sizes) of boxes that can be used for packing. |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 VERSION |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
version 1.0200 |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 SYNOPSIS |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
my $item = Box::Calc::BoxType->new(name => 'Apple', x => 3, y => 3.3, z => 4, weight => 5 ); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 METHODS |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head2 new(params) |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
Constructor. |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=over |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=item params |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=over |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=item x |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
The interior width of your box. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=item y |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
The interior length of your box. |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=item z |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
The interior thickness of your box. |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=item name |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
The name of your box. |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=item weight |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
The weight of your box. |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=back |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=back |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head2 name |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Returns the name of this box. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head2 category |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Returns the category name associated with this box type if any. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=cut |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
has name => ( |
71
|
|
|
|
|
|
|
is => 'ro', |
72
|
|
|
|
|
|
|
isa => 'Str', |
73
|
|
|
|
|
|
|
required => 1, |
74
|
|
|
|
|
|
|
); |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
has category => ( |
77
|
|
|
|
|
|
|
is => 'ro', |
78
|
|
|
|
|
|
|
isa => 'Str', |
79
|
|
|
|
|
|
|
default => '', |
80
|
|
|
|
|
|
|
); |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
sub describe { |
83
|
14
|
|
|
14
|
0
|
17
|
my $self = shift; |
84
|
|
|
|
|
|
|
return { |
85
|
14
|
|
|
|
|
390
|
name => $self->name, |
86
|
|
|
|
|
|
|
weight => $self->weight, |
87
|
|
|
|
|
|
|
x => $self->x, |
88
|
|
|
|
|
|
|
y => $self->y, |
89
|
|
|
|
|
|
|
z => $self->z, |
90
|
|
|
|
|
|
|
category=> $self->category, |
91
|
|
|
|
|
|
|
}; |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
|
95
|
8
|
|
|
8
|
|
38
|
no Moose; |
|
8
|
|
|
|
|
22
|
|
|
8
|
|
|
|
|
41
|
|
96
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |