Mercurial > pub > buggler
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 6:2a5f38eb25a9 | 7:29309bc8d932 |
|---|---|
| 1 package Benzin::Bugzilla::Bug; | |
| 2 use strict; | |
| 3 | |
| 4 my @bugFields; | |
| 5 | |
| 6 BEGIN { | |
| 7 @bugFields = qw( | |
| 8 id | |
| 9 summary | |
| 10 creation_time | |
| 11 last_change_time | |
| 12 creator | |
| 13 assigned_to | |
| 14 qa_contact | |
| 15 cc | |
| 16 | |
| 17 status | |
| 18 resolution | |
| 19 | |
| 20 priority | |
| 21 severity | |
| 22 url | |
| 23 | |
| 24 blocks | |
| 25 depends_on | |
| 26 | |
| 27 | |
| 28 component | |
| 29 product | |
| 30 classification | |
| 31 version | |
| 32 | |
| 33 actual_time | |
| 34 estimated_time | |
| 35 remaining_time | |
| 36 deadline | |
| 37 | |
| 38 comments | |
| 39 ); | |
| 40 } | |
| 41 | |
| 42 use constant { | |
| 43 BUG_FIELDS => \@bugFields | |
| 44 }; | |
| 45 | |
| 46 use IMPL::declare { | |
| 47 base => [ | |
| 48 'IMPL::Object::Fields' => undef | |
| 49 ] | |
| 50 }; | |
| 51 | |
| 52 use fields @bugFields; | |
| 53 | |
| 54 sub CTOR { | |
| 55 my SELF $this = shift; | |
| 56 my $data = shift; | |
| 57 | |
| 58 $this->{$_} = $data->{$_} foreach grep exists $data->{$_}, SELF->BUG_FIELDS; | |
| 59 } | |
| 60 | |
| 61 sub GetEffort { | |
| 62 my SELF $this = shift; | |
| 63 | |
| 64 return $this->{actual_time} + $this->{remaining_time}; | |
| 65 } | |
| 66 | |
| 67 1; |
