| 1 | package TUI::Objects::Object; | ||||||||||||||||||||||||||||
| 2 | # ABSTRACT: defines the class TObject | ||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||
| 4 | 105 | ▶ | use 5.010; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 105 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 105 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 105 | our $VERSION = '2.000002'; | |||||||||||||||||||||||||||
| 9 | 105 | $VERSION =~ tr/_//d; | |||||||||||||||||||||||||||
| 10 | 105 | our $AUTHORITY = 'cpan:BRICKPOOL'; | |||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 105 | ▶ | use Exporter 'import'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | 105 | our @EXPORT = qw( | |||||||||||||||||||||||||||
| 14 | TObject | ||||||||||||||||||||||||||||
| 15 | new_TObject | ||||||||||||||||||||||||||||
| 16 | ); | ||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 105 | ▶ | use Devel::StrictMode; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 19 | 105 | ▶ | use Scalar::Util qw( | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 20 | weaken | ||||||||||||||||||||||||||||
| 21 | isweak | ||||||||||||||||||||||||||||
| 22 | 105 | ); | |||||||||||||||||||||||||||
| 23 | 105 | ▶ | use TUI::toolkit; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 24 | 105 | ▶ | use TUI::toolkit::Types qw( | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 25 | Maybe | ||||||||||||||||||||||||||||
| 26 | :is | ||||||||||||||||||||||||||||
| 27 | :types | ||||||||||||||||||||||||||||
| 28 | 105 | ); | |||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | sub TObject() { __PACKAGE__ } | ||||||||||||||||||||||||||||
| 31 | 1 | ▶ | sub new_TObject { __PACKAGE__->from(@_) } | ||||||||||||||||||||||||||
|
Subroutine
new_TObject: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 0 | ▶ | my $unlock_value = sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||
| 34 | 0 | ▶ | Internals::SvREADONLY( $_[0] => 0 ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 35 | if exists &Internals::SvREADONLY; | ||||||||||||||||||||||||||||
| 36 | 105 | }; | |||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | 8 | ▶ | sub BUILDARGS { # \%args () | ||||||||||||||||||||||||||
|
Subroutine
BUILDARGS: called CC=2 SCAR=7.1
Pod
documented
| |||||||||||||||||||||||||||||
| 39 | 8 | state $sig = signature( | |||||||||||||||||||||||||||
| 40 | method => 1, | ||||||||||||||||||||||||||||
| 41 | named => [], | ||||||||||||||||||||||||||||
| 42 | caller_level => +1, | ||||||||||||||||||||||||||||
| 43 | ); | ||||||||||||||||||||||||||||
| 44 | 8 | my ( $class, $args ) = $sig->( @_ ); | |||||||||||||||||||||||||||
| 45 | 8 | ▶ | return $args ? { %$args } : {}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | 2 | ▶ | sub from { # $obj (); | ||||||||||||||||||||||||||
|
Subroutine
from: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 49 | 2 | state $sig = signature( | |||||||||||||||||||||||||||
| 50 | method => 1, | ||||||||||||||||||||||||||||
| 51 | pos => [], | ||||||||||||||||||||||||||||
| 52 | ); | ||||||||||||||||||||||||||||
| 53 | 2 | my ( $class ) = $sig->( @_ ); | |||||||||||||||||||||||||||
| 54 | 2 | return $class->new(); | |||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | 1 | ▶ | sub destroy { # void ($class|$self, $o|undef) | ||||||||||||||||||||||||||
|
Subroutine
destroy: called CC=11 SCAR=30.7
Pod
documented
| |||||||||||||||||||||||||||||
| 58 | 1 | my ( $class, $o ) = @_; | |||||||||||||||||||||||||||
| 59 | 1 | ▶ | assert ( defined $class ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 60 | 1 | ▶ | assert ( !defined $o or is_Object $o ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
not defined $o or &is_Object($o)
MC/DC0%0/2
not defined $o or &is_Object($o)
not defined $o
&is_Object($o)
Truth table33%1/3
not(A) or B
A= not defined $oB= &is_Object($o)
| |||||||||||||||||||||||||||||
| 61 | 1 | ▶ | $class = ref $class || $class; | ||||||||||||||||||||||||||
|
Condition33%1/3
ref $class || $class
MC/DC0%0/2
ref $class || $class
ref $class
$class
Truth table33%1/3
A || B
A= ref $classB= $class
| |||||||||||||||||||||||||||||
| 62 | 1 | alias: for $o ( $_[1] ) { | |||||||||||||||||||||||||||
| 63 | 1 | ▶ | if ( defined $o ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 64 | 1 | ▶ | assert ( is_Object $o ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 65 | 1 | $o->shutDown(); | |||||||||||||||||||||||||||
| 66 | 1 | for ( keys %$o ) { | |||||||||||||||||||||||||||
| 67 | 0 | ▶ | if ( ref $o->{$_} && !isweak $o->{$_} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
ref $o->{$_} and not builtin::is_weak($o->{$_})
MC/DC0%0/2
ref $o->{$_} and not builtin::is_weak($o->{$_})
ref $o->{$_}
not builtin::is_weak($o->{$_})
Truth table0%0/3
A and not(B)
A= ref $o->{$_}B= not builtin::is_weak($o->{$_})
| |||||||||||||||||||||||||||||
| 68 | 0 | &$unlock_value( $o->{$_} ) if STRICT; | |||||||||||||||||||||||||||
| 69 | 0 | weaken $o->{$_}; | |||||||||||||||||||||||||||
| 70 | } | ||||||||||||||||||||||||||||
| 71 | } | ||||||||||||||||||||||||||||
| 72 | 1 | undef $o; | |||||||||||||||||||||||||||
| 73 | } | ||||||||||||||||||||||||||||
| 74 | 1 | return; | |||||||||||||||||||||||||||
| 75 | } #/ alias | ||||||||||||||||||||||||||||
| 76 | } | ||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||
| 78 | 22 | ▶ | sub shutDown { # void ($self) | ||||||||||||||||||||||||||
|
Subroutine
shutDown: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 79 | 22 | state $sig = signature( | |||||||||||||||||||||||||||
| 80 | method => Object, | ||||||||||||||||||||||||||||
| 81 | pos => [], | ||||||||||||||||||||||||||||
| 82 | ); | ||||||||||||||||||||||||||||
| 83 | 22 | $sig->( @_ ); | |||||||||||||||||||||||||||
| 84 | 22 | return; | |||||||||||||||||||||||||||
| 85 | } | ||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||
| 87 | 105 | 1 | |||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||
| 89 | __END__ | ||||||||||||||||||||||||||||