File Coverage

blib/lib/Catalyst/Controller/DBIC/API/Request.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 5 60.0
pod n/a
total 12 14 85.7


line stmt bran cond sub pod time code
1             package Catalyst::Controller::DBIC::API::Request;
2             $Catalyst::Controller::DBIC::API::Request::VERSION = '2.008001';
3             #ABSTRACT: Provides a role to be applied to the Request object
4 16     16   121 use Moose::Role;
  16         45  
  16         171  
5 16     16   87069 use MooseX::Types::Moose(':all');
  16         56  
  16         128  
6 16     16   136073 use namespace::autoclean;
  16         48  
  16         176  
7              
8             #XXX HACK to satisfy the used roles requirements
9             # see Moose test todo_tests/required_role_accessors.t
10       0     sub _application { }
11       0     sub _controller { }
12              
13              
14             has '_application' => (
15             is => 'ro',
16             writer => '_set_application',
17             isa => Object | ClassName,
18             );
19              
20             has '_controller' => (
21             is => 'ro',
22             writer => '_set_controller',
23             isa => Object,
24             trigger => sub {
25             my ( $self, $new ) = @_;
26              
27             $self->_set_class( $new->class ) if defined( $new->class );
28             $self->_set_application( $new->_application );
29             $self->_set_search_exposes( $new->search_exposes );
30             $self->_set_select_exposes( $new->select_exposes );
31             },
32             handles => ['prefetch_validator'],
33             );
34              
35             with 'Catalyst::Controller::DBIC::API::StoredResultSource',
36             'Catalyst::Controller::DBIC::API::RequestArguments',
37             'Catalyst::Controller::DBIC::API::Request::Context';
38              
39              
40             1;
41              
42             __END__
43              
44             =pod
45              
46             =head1 NAME
47              
48             Catalyst::Controller::DBIC::API::Request - Provides a role to be applied to the Request object
49              
50             =head1 VERSION
51              
52             version 2.008001
53              
54             =head1 DESCRIPTION
55              
56             Please see L<Catalyst::Controller::DBIC::API::RequestArguments> and
57             L<Catalyst::Controller::DBIC::API::Request::Context> for the details of this
58             class, as both of those roles are consumed in this role.
59              
60             =head1 PRIVATE_ATTRIBUTES
61              
62             =head2 _application
63              
64             This attribute helps bridge between the request guts and the application guts;
65             allows request argument validation against the schema. This is set during
66             L<Catalyst::Controller::DBIC::API/inflate_request>.
67              
68             =head1 AUTHORS
69              
70             =over 4
71              
72             =item *
73              
74             Nicholas Perez <nperez@cpan.org>
75              
76             =item *
77              
78             Luke Saunders <luke.saunders@gmail.com>
79              
80             =item *
81              
82             Alexander Hartmaier <abraxxa@cpan.org>
83              
84             =item *
85              
86             Florian Ragwitz <rafl@debian.org>
87              
88             =item *
89              
90             Oleg Kostyuk <cub.uanic@gmail.com>
91              
92             =item *
93              
94             Samuel Kaufman <sam@socialflow.com>
95              
96             =back
97              
98             =head1 COPYRIGHT AND LICENSE
99              
100             This software is copyright (c) 2019 by Luke Saunders, Nicholas Perez, Alexander Hartmaier, et al.
101              
102             This is free software; you can redistribute it and/or modify it under
103             the same terms as the Perl 5 programming language system itself.
104              
105             =cut