line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Box::Calc::Item; |
2
|
|
|
|
|
|
|
$Box::Calc::Item::VERSION = '1.0200'; |
3
|
13
|
|
|
13
|
|
120273
|
use strict; |
|
13
|
|
|
|
|
29
|
|
|
13
|
|
|
|
|
363
|
|
4
|
13
|
|
|
13
|
|
64
|
use warnings; |
|
13
|
|
|
|
|
23
|
|
|
13
|
|
|
|
|
383
|
|
5
|
13
|
|
|
13
|
|
3026
|
use Moose; |
|
13
|
|
|
|
|
1835105
|
|
|
13
|
|
|
|
|
96
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
with 'Box::Calc::Role::Dimensional'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Box::Calc::Item - The container class for the items you wish to pack. |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 VERSION |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
version 1.0200 |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 SYNOPSIS |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
my $item = Box::Calc::Item->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 width of your item. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=item y |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
The length of your item. |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=item z |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
The thickness of your item. |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=item weight |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
The weight of your item. |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=item name |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
The name of your item. If you're referring it back to an external system you may wish to use this field to store you item ids instead of item names. |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=back |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=back |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head2 name |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Returns the name of this item. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=cut |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
has name => ( |
66
|
|
|
|
|
|
|
is => 'ro', |
67
|
|
|
|
|
|
|
isa => 'Str', |
68
|
|
|
|
|
|
|
required => 1, |
69
|
|
|
|
|
|
|
); |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head2 describe |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Returns all the important details about this item as a hash reference. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=cut |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub describe { |
78
|
10460
|
|
|
10460
|
1
|
11844
|
my $self = shift; |
79
|
|
|
|
|
|
|
return { |
80
|
10460
|
|
|
|
|
278786
|
name => $self->name, |
81
|
|
|
|
|
|
|
weight => $self->weight, |
82
|
|
|
|
|
|
|
x => $self->x, |
83
|
|
|
|
|
|
|
y => $self->y, |
84
|
|
|
|
|
|
|
z => $self->z, |
85
|
|
|
|
|
|
|
}; |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 ROLES |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
This class installs L<Box::Calc::Role::Dimensional>. |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=cut |
93
|
|
|
|
|
|
|
|
94
|
13
|
|
|
13
|
|
78896
|
no Moose; |
|
13
|
|
|
|
|
29
|
|
|
13
|
|
|
|
|
93
|
|
95
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |