Lighthouse/Project/Ticket/Version.pm

filter: Statementstmt 100% 24 / 24 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 100% 30 / 30 CC 2 SCAR 2.9
CC
2
Cov
100%
load_from_xml
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« Lighthouse/User/Membership.pm ↑ Summary Lighthouse.pm »
1 package Net::Lighthouse::Project::Ticket::Version;
2 3 ▶use Any::Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 3 ▶use Params::Validate ':all';
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use Net::Lighthouse::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 # read only attr
7 3 has [qw/created_at updated_at/] => (
8 isa => 'DateTime',
9 is => 'ro',
10 );
11  
12 3 has [
13 qw/milestone_id assigned_user_id number user_id
14 project_id creator_id attachments_count/
15 ] => (
16 isa => 'Maybe[Int]',
17 is => 'ro',
18 );
19  
20 3 has [qw/closed/] => (
21 isa => 'Bool',
22 is => 'ro',
23 );
24  
25 3 has [qw/diffable_attributes/] => (
26 isa => 'HashRef',
27 is => 'ro',
28 );
29  
30 3 has [
31 'assigned_user_name', 'body',
32 'body_html', 'permalink',
33 'state', 'tag',
34 'title', 'user_id',
35 'user_name', 'creator_name',
36 'url', 'milestone_title',
37 ] => (
38 isa => 'Maybe[Str]',
39 is => 'ro',
40 );
41  
42 3 ▶no Any::Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
43 3 __PACKAGE__->meta->make_immutable;
44  
45 2 ▶sub load_from_xml {
Subroutine load_from_xml: called CC=2 SCAR=6.9
Pod documented
46 2 my $self = shift;
47 2 my $ref = Net::Lighthouse::Util->translate_from_xml(shift);
48  
49 # dirty hack: some attrs are read-only, and Mouse doesn't support
50 # writer => '...'
51 2 for my $k ( keys %$ref ) {
52 44 $self->{$k} = $ref->{$k};
53 }
54 2 return $self;
55 }
56  
57 3 1;
58  
59 __END__
« Lighthouse/User/Membership.pm ↑ Summary Lighthouse.pm »