| 1 | 1 | ▶ | use Renard::Incunabula::Common::Setup; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 2 | package Intertangle::Punchcard::Backend::Kiwisolver::Symbolic; | ||||||||||||||||||||||||||||
| 3 | # ABSTRACT: Kiwisolver variable | ||||||||||||||||||||||||||||
| 4 | 1 | $Intertangle::Punchcard::Backend::Kiwisolver::Symbolic::VERSION = '0.002'; | |||||||||||||||||||||||||||
| 5 | 1 | ▶ | use Mu; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use Graphics::Layout::Kiwisolver; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use Renard::Incunabula::Common::Types qw(InstanceOf); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 1 | ▶ | use overload nomethod => \&_delegate_op; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 1 | has name => ( is => 'ro', predicate => 1 ); | |||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 17 | has _delegate => ( | |||||||||||||||||||||||||||
| 13 | is => 'ro', | ||||||||||||||||||||||||||||
| 14 | isa => ( | ||||||||||||||||||||||||||||
| 15 | InstanceOf['Graphics::Layout::Kiwisolver::Variable'] | ||||||||||||||||||||||||||||
| 16 | | InstanceOf['Graphics::Layout::Kiwisolver::Term'] | ||||||||||||||||||||||||||||
| 17 | | InstanceOf['Graphics::Layout::Kiwisolver::Expression'] | ||||||||||||||||||||||||||||
| 18 | | InstanceOf['Graphics::Layout::Kiwisolver::Constraint'] | ||||||||||||||||||||||||||||
| 19 | ), | ||||||||||||||||||||||||||||
| 20 | 17 | ▶ | default => method() { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 21 | 17 | Graphics::Layout::Kiwisolver::Variable->new; | |||||||||||||||||||||||||||
| 22 | 1 | }, | |||||||||||||||||||||||||||
| 23 | ); | ||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | 60 | ▶ | method BUILD() { | ||||||||||||||||||||||||||
|
Subroutine
BUILD: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 26 | 60 | ▶ | if( $self->has_name ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 27 | 17 | $self->_delegate->setName( $self->name ); | |||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||
| 29 | 1 | } | |||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 43 | ▶ | method _delegate_op($other, $inv, $meth) { | ||||||||||||||||||||||||||
|
Subroutine
_delegate_op: called CC=5 SCAR=16.5
| |||||||||||||||||||||||||||||
| 32 | 43 | my $op = overload::Method($self->_delegate, $meth); | |||||||||||||||||||||||||||
| 33 | 43 | ▶ | die "Operator $meth not available" unless defined $op; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 34 | 43 | ▶ | my $return = $op->($self->_delegate, defined $other && ref $other ? $other->_delegate : $other , $inv ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $other and ref $other
MC/DC50%1/2
defined $other and ref $other
defined $other
ref $other
Truth table66%2/3
A and B
A= defined $otherB= ref $other
| |||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | 43 | ▶ | if( $meth eq '""') { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 37 | 0 | return $return; | |||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | 43 | my $return_wrapper; | |||||||||||||||||||||||||||
| 41 | 43 | $return_wrapper = Intertangle::Punchcard::Backend::Kiwisolver::Symbolic->new( | |||||||||||||||||||||||||||
| 42 | _delegate => $return, | ||||||||||||||||||||||||||||
| 43 | ); | ||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | 43 | $return_wrapper; | |||||||||||||||||||||||||||
| 46 | 1 | } | |||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | 12 | ▶ | method value($value = undef) { | ||||||||||||||||||||||||||
|
Subroutine
value: called CC=2 SCAR=7.2
Pod
documented
| |||||||||||||||||||||||||||||
| 49 | 12 | ▶ | if( defined $value ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 50 | 0 | $self->_delegate->setValue( $value ); | |||||||||||||||||||||||||||
| 51 | } else { | ||||||||||||||||||||||||||||
| 52 | 12 | $self->_delegate->value; | |||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||
| 54 | 1 | } | |||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | 1 | with qw(Intertangle::Punchcard::Data::Role::Variable); | |||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | 1 | 1; | |||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | __END__ | ||||||||||||||||||||||||||||