blib/lib/Astro/Nova/ZoneDate.pm

filter: Statementstmt 100% 25 / 25 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 100% 4 / 4 totaltotal 100% 41 / 41 CC 4 SCAR 7.4
CC
4
Cov
100%
set_all
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.1
« buildtools/makeNovaClass.pl ↑ Summary XS/ApparentPosition.xs »
1 package Astro::Nova::ZoneDate;
2  
3 3 ▶use 5.008;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 ▶use Astro::Nova;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 # basic stuff is in Astro::Nova's XS!
10  
11 10 ▶sub members {
Subroutine members: called CC=1 SCAR=0.0
Pod documented
12 10 return qw/years months days hours minutes seconds gmtoff/;
13 }
14  
15 1 ▶sub as_ascii {
Subroutine as_ascii: called CC=1 SCAR=0.0
Pod documented
16 1 my $self = shift;
17 1 my $template = <<'HERE';
18 Year: %d
19 Month: %d
20 Day: %d
21 Hours: %d
22 Minutes: %d
23 Seconds: %f
24 GMT Offset: %d
25 HERE
26 1 return sprintf($template, $self->get_all());
27 }
28  
29 7 ▶sub get_all {
Subroutine get_all: called CC=1 SCAR=0.0
Pod documented
30 7 my $self = shift;
31 7 return(map $self->$_(), map "get_$_", $self->members());
32 }
33  
34 2 ▶sub set_all {
Subroutine set_all: called CC=4 SCAR=13.9
Pod documented
35 2 my $self = shift;
36 2 foreach my $member (map "set_$_", $self->members) {
37 6 ▶ last if not @_;
Branch: 1 branch
BranchTrueFalseTotal
unless @_ 2 4 6
38 4 my $value = shift @_;
39 4 ▶ next if not defined $value;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $value 2 2 4
40 2 $self->$member($value);
41 }
42 2 return 1;
43 }
44  
45 3 1;
46 __END__
« buildtools/makeNovaClass.pl ↑ Summary XS/ApparentPosition.xs »