R53/Role/NewFromRawData.pm

filter: Statementstmt 66.6% 16 / 24 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 100% 1 / 1 totaltotal 65.6% 21 / 32 CC 3 SCAR 17.4
CC
3
Cov
62%
new_from_raw_data
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 5.7
« R53.pm ↑ Summary R53/ResourceRecordSet/Change.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::Role::NewFromRawData;
11 {
12 1 $Net::Amazon::R53::Role::NewFromRawData::VERSION = '0.002'; # TRIAL
13 }
14  
15 # ABSTRACT: Constructs instances from just the returned raw_data
16  
17 1 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use MooseX::AttributeShortcuts;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 1 ▶use String::CamelCase 'decamelize';
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 # debugging...
24 #use Smart::Comments '###';
25  
26  
27 1 has raw_data => (is => 'ro', isa => 'HashRef', required => 1);
28  
29  
30 0 ▶sub new_from_raw_data {
Subroutine new_from_raw_data: not called CC=3 SCAR=24.8
Pod documented
31 0 my ($class, $r53, $raw_data, @other_args) = @_;
32  
33 0 my %params = (raw_data => $raw_data);
34 0 my $meta = $class->meta;
35  
36 0 for my $key (keys %$raw_data) {
37  
38 0 my $att_name = decamelize $key;
39 0 $key =~ s/::/__/g;
40 0 ▶ $params{$att_name} = $raw_data->{$key}
Branch: 1 branch
BranchTrueFalseTotal
if $meta->find_attribute_by_name($att_name) 0 0 0
41 if $meta->find_attribute_by_name($att_name);
42 }
43  
44 ### %params
45 0 return $class->new(r53 => $r53, %params, @other_args);
46 }
47  
48 1 !!42;
49  
50 __END__
« R53.pm ↑ Summary R53/ResourceRecordSet/Change.pm »