File Coverage

blib/lib/WebService/Beeminder/Types.pm
Criterion Covered Total %
statement 15 15 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod n/a
total 20 20 100.0


line stmt bran cond sub pod time code
1             package WebService::Beeminder::Types;
2 4     4   123 use 5.010;
  4         15  
  4         164  
3 4     4   26 use strict;
  4         8  
  4         147  
4 4     4   25 use warnings;
  4         7  
  4         320  
5              
6             # ABSTRACT: Types for WebService::Beeminder
7             our $VERSION = '0.003'; # VERSION: Generated by DZP::OurPkg:Version
8              
9 4         98 use MooseX::Types -declare => [
10             qw(
11             BeeBool
12             Goal
13             User
14             )
15 4     4   22 ];
  4         8  
16              
17 4     4   29315 use MooseX::Types::Moose qw(Str Bool);
  4         9  
  4         48  
18              
19             subtype BeeBool,
20             as Str,
21             where { /^(?:true|false)$/ }
22             ;
23              
24             coerce BeeBool,
25             from Bool,
26             via { $_ ? "true" : "false" }
27             ;
28              
29             coerce Bool,
30             from BeeBool,
31             via { $_ eq "true" }
32             ;
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             subtype Goal,
38             as Str
39             ;
40              
41             subtype User,
42             as Str
43             ;
44              
45             1;
46              
47             __END__
48              
49             =pod
50              
51             =head1 NAME
52              
53             WebService::Beeminder::Types - Types for WebService::Beeminder
54              
55             =head1 VERSION
56              
57             version 0.003
58              
59             =head1 AUTHOR
60              
61             Paul Fenwick <pjf@cpan.org>
62              
63             =head1 COPYRIGHT AND LICENSE
64              
65             This software is copyright (c) 2012 by Paul Fenwick.
66              
67             This is free software; you can redistribute it and/or modify it under
68             the same terms as the Perl 5 programming language system itself.
69              
70             =cut