annotate lib/Benzin/Bugzilla/Bug.pm @ 7:29309bc8d932

initial objects to work with bugzilla web service
author cin
date Fri, 04 Sep 2015 19:41:28 +0300
parents
children cc7244ab1b9f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
1 package Benzin::Bugzilla::Bug;
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
2 use strict;
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
3
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
4 my @bugFields;
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
5
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
6 BEGIN {
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
7 @bugFields = qw(
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
8 id
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
9 summary
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
10 creation_time
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
11 last_change_time
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
12 creator
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
13 assigned_to
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
14 qa_contact
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
15 cc
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
16
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
17 status
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
18 resolution
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
19
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
20 priority
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
21 severity
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
22 url
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
23
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
24 blocks
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
25 depends_on
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
26
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
27
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
28 component
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
29 product
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
30 classification
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
31 version
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
32
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
33 actual_time
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
34 estimated_time
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
35 remaining_time
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
36 deadline
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
37
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
38 comments
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
39 );
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
40 }
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
41
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
42 use constant {
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
43 BUG_FIELDS => \@bugFields
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
44 };
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
45
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
46 use IMPL::declare {
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
47 base => [
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
48 'IMPL::Object::Fields' => undef
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
49 ]
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
50 };
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
51
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
52 use fields @bugFields;
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
53
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
54 sub CTOR {
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
55 my SELF $this = shift;
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
56 my $data = shift;
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
57
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
58 $this->{$_} = $data->{$_} foreach grep exists $data->{$_}, SELF->BUG_FIELDS;
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
59 }
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
60
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
61 sub GetEffort {
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
62 my SELF $this = shift;
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
63
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
64 return $this->{actual_time} + $this->{remaining_time};
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
65 }
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
66
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
67 1;