R53/ResourceRecordSet/Change.pm

filter: Statementstmt 95.8% 46 / 48 Branchbran 25.0% 1 / 4 Conditioncond 16.6% 1 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 100% 12 / 12 Podpod n/a totaltotal 81.0% 60 / 74 CC 5 SCAR 14.2
CC
5
Cov
83%
_build_record
11.1
BEGIN
1.0
BEGIN
1.0
CRAP 4.2
« R53/Role/NewFromRawData.pm ↑ Summary R53/ResourceRecordSet/Stub.pm »
1 #
2 # This file is part of Net-Amazon-R53
3 #
4 # This software is Copyright (c) 2012 by Campus Explorer, Inc.
5 #
6 # This is free software, licensed under:
7 #
8 # The GNU Lesser General Public License, Version 2.1, February 1999
9 #
10 package Net::Amazon::R53::ResourceRecordSet::Change;
11 {
12 1 $Net::Amazon::R53::ResourceRecordSet::Change::VERSION = '0.002'; # TRIAL
13 }
14  
15 # ABSTRACT: A representation of a resource record set change
16  
17 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use autobox::Core;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 1 ▶use MooseX::StrictConstructor;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 1 ▶use MooseX::AttributeShortcuts 0.017;
Subroutine BEGIN: called CC=1 SCAR=0.0
22 1 ▶use Moose::Util::TypeConstraints;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 1 ▶use MooseX::Types::Moose ':all';
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 1 ▶use aliased 'Net::Amazon::R53::ResourceRecordSet::Stub';
Subroutine BEGIN: called CC=1 SCAR=0.0
26 1 ▶use constant StubType => class_type Stub;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 1 ▶use constant NetDNSRRType => class_type 'Net::DNS::RR';
Subroutine BEGIN: called CC=1 SCAR=0.0
28  
29 1 ▶use aliased 'MooseX::Types::VariantTable';
Subroutine BEGIN: called CC=1 SCAR=0.0
30  
31 1 with 'MooseX::Traitor';
32 1 with 'Net::Amazon::R53::Role::ParentR53';
33  
34  
35 1 has action => (
36 is => 'ro',
37 isa_enum => [ qw{ CREATE DELETE } ],
38 required => 1,
39 );
40  
41 # XXX why am I not using coercions here?!
42  
43 1 has raw_record => (
44 is => 'ro',
45 isa => union([ HashRef, StubType, NetDNSRRType ]),
46 init_arg => 'record',
47 required => 1,
48 );
49  
50 1 has record => (
51 is => 'lazy',
52 isa => StubType,
53 init_arg => undef,
54 builder => 1,
55 );
56  
57 4 ▶sub _build_record {
Subroutine _build_record: called CC=5 SCAR=24.1
58 4 my $self = shift @_;
59  
60 4 my $raw = $self->raw_record;
61 4 my $stub_class = $self->resource_record_set__stub_class;
62  
63 4 ▶ return $raw
Branch: 1 branch
BranchTrueFalseTotal
if builtin::blessed($raw) and $raw->isa("Net::Amazon::R53::ResourceRecordSet::Stub") 4 0 4
Condition33%1/3
builtin::blessed($raw) and $raw->isa("Net::Amazon::R53::ResourceRecordSet::Stub")
!ll&&!rl&&r
004
MC/DC0%0/2
builtin::blessed($raw) and $raw->isa("Net::Amazon::R53::ResourceRecordSet::Stub")
builtin::blessed($raw) $raw->isa("Net::Amazon::R53::ResourceRecordSet::Stub")
Truth table33%1/3
A and B
A= builtin::blessed($raw)B= $raw->isa("Net::Amazon::R53::ResourceRecordSet::Stub")
ABresult
0X0
100
111
64 if blessed $raw && $raw->isa(Stub);
65  
66 0 ▶ return $stub_class->new_from_net_dns_rr($raw)
Branch: 1 branch
BranchTrueFalseTotal
if builtin::blessed($raw) and $raw->isa("Net::DNS::RR") 0 0 0
Condition0%0/3
builtin::blessed($raw) and $raw->isa("Net::DNS::RR")
!ll&&!rl&&r
000
MC/DC0%0/2
builtin::blessed($raw) and $raw->isa("Net::DNS::RR")
builtin::blessed($raw) $raw->isa("Net::DNS::RR")
Truth table0%0/3
A and B
A= builtin::blessed($raw)B= $raw->isa("Net::DNS::RR")
ABresult
0X0
100
111
67 if blessed $raw && $raw->isa('Net::DNS::RR');
68  
69 #return $self->resource_record_set__stub_class->new($self->raw_record);
70 0 return $stub_class->new($self->raw_record);
71 }
72  
73 # TODO this should be a nicer way to dispatch vs the present method
74 #has _record_builder_table => (
75 #is => 'lazy',
76 ## TODO isa
77 ## TODO handles
78 #);
79  
80 #sub _build__record_builder_table {
81 #my $self = shift @_;
82  
83 #VariantTable->new(variants => [
84 #{
85 #type => class_type('Net::DNS::RR'),
86 #value => sub { $self->_from_net_dns_rr(@_) },
87 #},
88 #{
89 #type => class_type(
90  
91 1 __PACKAGE__->meta->make_immutable;
92 1 !!42;
93  
94 __END__
« R53/Role/NewFromRawData.pm ↑ Summary R53/ResourceRecordSet/Stub.pm »