| 1 | 1 | ▶ | use Renard::Incunabula::Common::Setup; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 2 | package Renard::Curie::Model::ViewOptions::Grid; | ||||||||||||||||||||||||||||
| 3 | # ABSTRACT: A set of options for grids | ||||||||||||||||||||||||||||
| 4 | 1 | $Renard::Curie::Model::ViewOptions::Grid::VERSION = '0.005'; | |||||||||||||||||||||||||||
| 5 | 1 | ▶ | use Moo; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use MooX::ShortHas; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use Renard::Incunabula::Common::Types qw(Maybe PositiveInt Bool); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 1 | ▶ | use Renard::Curie::Error; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | # Need to use the ::BuildArgs version since is_continuous_view is lazy. | ||||||||||||||||||||||||||||
| 11 | 1 | with qw(MooX::BuildArgs MooX::Role::CloneSet::BuildArgs); | |||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | has [ qw/rows columns/ ] => ( | ||||||||||||||||||||||||||||
| 14 | is => 'ro', | ||||||||||||||||||||||||||||
| 15 | required => 1, | ||||||||||||||||||||||||||||
| 16 | 10 | ▶ | isa => sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||
| 17 | 10 | ▶ | ( Maybe[PositiveInt] )->check($_[0]) or | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 18 | Renard::Curie::Error::ViewOptions::InvalidGridOptions->throw( | ||||||||||||||||||||||||||||
| 19 | msg => 'Grid extent must be Maybe[PositiveInt]', | ||||||||||||||||||||||||||||
| 20 | ); | ||||||||||||||||||||||||||||
| 21 | }, | ||||||||||||||||||||||||||||
| 22 | 1 | ); | |||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 3 | ▶ | lazy is_continuous_view => method() { | ||||||||||||||||||||||||||
|
Subroutine
_build_is_continuous_view: called CC=2 SCAR=7.0
| |||||||||||||||||||||||||||||
| 25 | 3 | ▶ | defined $self->rows xor | ||||||||||||||||||||||||||
|
Condition75%3/4
defined $self->rows ^^ defined $self->columns
MC/DC100%2/2
defined $self->rows ^^ defined $self->columns
defined $self->rows
defined $self->columns
Truth table75%3/4
A ^^ B
A= defined $self->rowsB= defined $self->columns
| |||||||||||||||||||||||||||||
| 26 | defined $self->columns; | ||||||||||||||||||||||||||||
| 27 | 1 | }, isa => Bool; | |||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 4 | ▶ | method BUILD() { | ||||||||||||||||||||||||||
|
Subroutine
BUILD: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||
| 30 | 4 | ▶ | unless( defined $self->rows or defined $self->columns ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $self->rows or defined $self->columns
MC/DC100%2/2
defined $self->rows or defined $self->columns
defined $self->rows
defined $self->columns
Truth table100%3/3
A or B
A= defined $self->rowsB= defined $self->columns
| |||||||||||||||||||||||||||||
| 31 | 1 | Renard::Curie::Error::ViewOptions::InvalidGridOptions->throw({ | |||||||||||||||||||||||||||
| 32 | msg => "At least one of the grid extents must be defined", | ||||||||||||||||||||||||||||
| 33 | }); | ||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||
| 35 | 1 | }; | |||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | 1 | 1; | |||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | __END__ | ||||||||||||||||||||||||||||