Geoffrey/Action/View.pm

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