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

sync
author cin
date Fri, 04 Sep 2015 19:42:15 +0300
parents 29309bc8d932
children cc7244ab1b9f
line wrap: on
line source

package Benzin::Bugzilla::BugComment;
use strict;

my @fields;

BEGIN {
    @fields = qw(
      id
      bug_id
      attachment_id
      count
      text
      creator
      creation_time
      is_private
      is_markdown
    );
}

use constant {
    BUG_FIELDS => \@fields
};

use IMPL::declare {
    base => [
       'IMPL::Object::Fields' => undef
    ]
};

use fields @fields;

sub CTOR {
    my SELF $this = shift;
    my $data = shift;
    
    $this->{$_} = $data->{$_} foreach grep exists $data->{$_}, SELF->BUG_FIELDS;
}


1;