Fey/Role/ColumnLike.pm

filter: Statementstmt 100% 22 / 22 Branchbran 100% 10 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod 100% 4 / 4 totaltotal 100% 45 / 45 CC 6 SCAR 5.4
CC
6
Cov
100%
_containing_table_name_or_alias
2.0
is_selectable
2.0
is_comparable
2.0
CRAP 1.7
« Fey/Literal/Term.pm ↑ Summary Fey/Table/Alias.pm »
1 package Fey::Role::ColumnLike;
2  
3 27 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 27 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 27 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 27 our $VERSION = '0.44';
8  
9 27 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 # This seems weird, but basically we're saying that column-like things
12 # do these four roles, but the implementation is different for
13 # column-like things (than for example, selectable things).
14 27 with(
15 'Fey::Role::Selectable' => { -excludes => 'is_selectable' },
16 'Fey::Role::Comparable' => { -excludes => 'is_comparable' },
17 'Fey::Role::Groupable' => { -excludes => 'is_groupable' },
18 'Fey::Role::Orderable' => { -excludes => 'is_orderable' },
19 );
20  
21 27 requires '_build_id', 'is_alias';
22  
23 152 ▶sub _containing_table_name_or_alias {
Subroutine _containing_table_name_or_alias: called CC=2 SCAR=6.9
24 152 my $t = $_[0]->table();
25  
26 152 ▶ $t->is_alias() ? $t->alias_name() : $t->name();
Branch: 1 branch
BranchTrueFalseTotal
$t->is_alias ? : 3 149 152
27 }
28  
29 27 ▶sub is_selectable { return $_[0]->table() ? 1 : 0 }
Subroutine is_selectable: called CC=2 SCAR=6.9
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
$_[0]->table ? : 26 1 27
30  
31 86 ▶sub is_comparable { return $_[0]->table() ? 1 : 0 }
Subroutine is_comparable: called CC=2 SCAR=6.9
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
$_[0]->table ? : 85 1 86
32  
33 5 ▶sub is_groupable { return $_[0]->table() ? 1 : 0 }
Subroutine is_groupable: called CC=2 SCAR=6.9
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
$_[0]->table ? : 4 1 5
34  
35 18 ▶sub is_orderable { return $_[0]->table() ? 1 : 0 }
Subroutine is_orderable: called CC=2 SCAR=6.9
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
$_[0]->table ? : 17 1 18
36  
37 27 1;
38  
39 # ABSTRACT: A role for "column-like" behavior
40  
41 __END__
« Fey/Literal/Term.pm ↑ Summary Fey/Table/Alias.pm »