We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fe1b623 commit 91445b2Copy full SHA for 91445b2
lib/MetaCPAN/Server/Model/ESQuery.pm
@@ -0,0 +1,31 @@
1
+package MetaCPAN::Server::Model::ESQuery;
2
+
3
+use Moose;
4
5
+use MetaCPAN::Query ();
6
7
+extends 'Catalyst::Model';
8
9
+has es => (
10
+ is => 'ro',
11
+ writer => '_set_es',
12
+);
13
14
+has _esx_query => (
15
16
+ lazy => 1,
17
+ default => sub {
18
+ my $self = shift;
19
+ MetaCPAN::Query->new( es => $self->es );
20
+ },
21
22
23
+sub ACCEPT_CONTEXT {
24
+ my ( $self, $c ) = @_;
25
+ if ( !$self->es ) {
26
+ $self->_set_es( $c->model('ES') );
27
+ }
28
+ return $self->_esx_query;
29
+}
30
31
+1;
0 commit comments