annotate lib/Benzin/Bugzilla/BugComment.pm @ 8:ff9c0c788382

sync
author cin
date Fri, 04 Sep 2015 19:42:15 +0300
parents 29309bc8d932
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::BugComment;
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 @fields;
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 @fields = qw(
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
8 id
8
cin
parents: 7
diff changeset
9 bug_id
cin
parents: 7
diff changeset
10 attachment_id
cin
parents: 7
diff changeset
11 count
cin
parents: 7
diff changeset
12 text
cin
parents: 7
diff changeset
13 creator
cin
parents: 7
diff changeset
14 creation_time
cin
parents: 7
diff changeset
15 is_private
cin
parents: 7
diff changeset
16 is_markdown
7
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
17 );
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
18 }
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 use constant {
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
21 BUG_FIELDS => \@fields
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
22 };
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 use IMPL::declare {
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
25 base => [
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
26 'IMPL::Object::Fields' => undef
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 };
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
29
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
30 use fields @fields;
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
31
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
32 sub CTOR {
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
33 my SELF $this = shift;
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
34 my $data = shift;
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
35
29309bc8d932 initial objects to work with bugzilla web service
cin
parents:
diff changeset
36 $this->{$_} = $data->{$_} foreach grep exists $data->{$_}, SELF->BUG_FIELDS;
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
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 1;