Beeminder/Types.pm

filter: Statementstmt 87.5% 21 / 24 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 62.5% 5 / 8 Podpod n/a totaltotal 76.4% 26 / 34 CC 2 SCAR 8.5
CC
2
Cov
81%
__ANON__
6.0
__ANON__
2.0
__ANON__
2.0
CRAP 2.3
« Beeminder.pm ↑ Summary
1 package WebService::Beeminder::Types;
2 4 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 # ABSTRACT: Types for WebService::Beeminder
7 4 our $VERSION = '0.003'; # VERSION: Generated by DZP::OurPkg:Version
8  
9 4 ▶use MooseX::Types -declare => [
Subroutine BEGIN: called CC=1 SCAR=0.0
10 qw(
11 BeeBool
12 Goal
13 User
14 )
15 4 ];
16  
17 4 ▶use MooseX::Types::Moose qw(Str Bool);
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 subtype BeeBool,
20 as Str,
21 0 ▶ where { /^(?:true|false)$/ }
Subroutine __ANON__: not called CC=1 SCAR=6.9
22 4 ;
23  
24 coerce BeeBool,
25 from Bool,
26 0 ▶ via { $_ ? "true" : "false" }
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
$_ ? : 0 0 0
27 4 ;
28  
29 coerce Bool,
30 from BeeBool,
31 0 ▶ via { $_ eq "true" }
Subroutine __ANON__: not called CC=1 SCAR=6.9
32 4 ;
33  
34 # Goal and User types are just strings, but we can tweak them later
35 # if there are restrictions as to what's a valid user or goal name.
36  
37 4 subtype Goal,
38 as Str
39 ;
40  
41 4 subtype User,
42 as Str
43 ;
44  
45 4 1;
46  
47 __END__
« Beeminder.pm ↑ Summary