Silki/AppRole/Domain.pm untested

filter: Statementstmt 0.0% 0 / 23 Branchbran n/a Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 33 CC 1 SCAR 6.9
CC
1
Cov
0%
_build_domain
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package Silki::AppRole::Domain;
2 {
3 $Silki::AppRole::Domain::VERSION = '0.29';
4 }
5  
6 use strict;
7 use warnings;
8 use namespace::autoclean;
9  
10 use Silki::Schema::Domain;
11  
12 use Moose::Role;
13  
14 has 'domain' => (
15 is => 'ro',
16 isa => 'Silki::Schema::Domain',
17 lazy => 1,
18 builder => '_build_domain',
19 );
20  
21 sub _build_domain {
22 my $self = shift;
23  
24 my $host = $self->request()->uri()->host();
25  
26 my $domain = Silki::Schema::Domain->new( web_hostname => $host )
27 or die "No domain found for hostname ($host)\n";
28  
29 return $domain;
30 }
31  
32 1;
33  
34 # ABSTRACT: Adds $c->domain() to the Catalyst object
35  
36 __END__