File Coverage

blib/lib/WebAPI/DBIC/Resource/Base.pm
Criterion Covered Total %
statement 9 11 81.8
branch n/a
condition n/a
subroutine 3 4 75.0
pod n/a
total 12 15 80.0


line stmt bran cond sub pod time code
1             package WebAPI::DBIC::Resource::Base;
2             $WebAPI::DBIC::Resource::Base::VERSION = '0.003002';
3              
4 12     12   9917889 use Moo;
  12         35278  
  12         74  
5 12     12   7882 use namespace::clean -except => [qw(meta)];
  12         44365  
  12         144  
6 12     12   4548 use MooX::StrictConstructor;
  12         41341  
  12         83  
7              
8             extends 'Web::Machine::Resource';
9              
10             require WebAPI::HTTP::Throwable::Factory;
11              
12             # vvv --- these allow us to use MooX::StrictConstructor
13             has 'request' => (is => 'ro');
14             has 'response' => (is => 'ro');
15             sub FOREIGNBUILDARGS {
16 0     0     my ($class, %args) = @_;
17 0           return (request => $args{request}, response => $args{response});
18             }
19             # ^^^ ---
20              
21             has writable => (
22             is => 'ro',
23             default => $ENV{WEBAPI_DBIC_WRITABLE},
24             );
25              
26             has http_auth_type => (
27             is => 'ro',
28             default => $ENV{WEBAPI_DBIC_HTTP_AUTH_TYPE} || 'Basic',
29             );
30              
31             has throwable => (
32             is => 'rw',
33             default => 'WebAPI::HTTP::Throwable::Factory',
34             );
35              
36             has type_namer => (
37             is => 'ro',
38             );
39              
40             1;
41              
42             __END__
43              
44             =pod
45              
46             =encoding UTF-8
47              
48             =head1 NAME
49              
50             WebAPI::DBIC::Resource::Base
51              
52             =head1 VERSION
53              
54             version 0.003002
55              
56             =head1 DESCRIPTION
57              
58             This class is a subclass of WebAPI::DBIC::Resource.
59              
60             =head1 NAME
61              
62             WebAPI::DBIC::Resource::Base - Base class for WebAPI::DBIC::Resource's
63              
64             =head1 AUTHOR
65              
66             Tim Bunce <Tim.Bunce@pobox.com>
67              
68             =head1 COPYRIGHT AND LICENSE
69              
70             This software is copyright (c) 2015 by Tim Bunce.
71              
72             This is free software; you can redistribute it and/or modify it under
73             the same terms as the Perl 5 programming language system itself.
74              
75             =cut