Geoffrey/Action/Constraint/Index.pm

filter: Statementstmt 100% 30 / 30 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod 100% 4 / 4 totaltotal 100% 47 / 47 CC 3 SCAR 4.4
CC
3
Cov
100%
drop
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.5
« Geoffrey/Changelog/None.pm ↑ Summary Geoffrey/Action/View.pm »
1 package Geoffrey::Action::Constraint::Index;
2  
3 7 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 7 ▶use 5.016;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 7 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 7 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 7 ▶use parent 'Geoffrey::Role::Action';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 7 $Geoffrey::Action::Constraint::Index::VERSION = '0.000206';
11  
12 9 ▶sub add {
Subroutine add: called CC=1 SCAR=0.0
Pod documented
13 9 my ( $self, $hr_params ) = @_;
14 9 return $self->do( $self->converter->index->add($hr_params) );
15 }
16  
17 3 ▶sub alter {
Subroutine alter: called CC=1 SCAR=0.0
Pod documented
18 3 my ( $self, $hr_params ) = @_;
19 3 return [ $self->drop($hr_params), $self->add($hr_params) ];
20 }
21  
22 7 ▶sub drop {
Subroutine drop: called CC=3 SCAR=11.0
Pod documented
23 7 my ( $self, $hr_params ) = @_;
24 7 require Ref::Util;
25 7 ▶ my $s_name = Ref::Util::is_hashref($hr_params) ? $hr_params->{name} : undef;
Branch: 1 branch
BranchTrueFalseTotal
&Ref::Util::is_hashref($hr_params) ? : 6 1 7
26 7 ▶ if ( !$s_name ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($s_name) 1 6 7
27 1 require Geoffrey::Exception::RequiredValue;
28 1 Geoffrey::Exception::RequiredValue::throw_index_name('to drop');
29 }
30 6 return $self->do( $self->converter->index->drop($s_name) );
31 }
32  
33 4 ▶sub list_from_schema {
Subroutine list_from_schema: called CC=1 SCAR=0.0
Pod documented
34 4 my ( $self, $schema ) = @_;
35 4 my $converter = $self->converter;
36 4 return $converter->index_information( $self->do_arrayref( $converter->index->list($schema) ) );
37  
38 }
39  
40 7 1;
41  
42 __END__
« Geoffrey/Changelog/None.pm ↑ Summary Geoffrey/Action/View.pm »