| 1 | package CXC::DB::DDL::CloneClear; | ||
| 2 | |||
| 3 | # ABSTRACT: Provide attribute tags and a method for Moo objects to indicate they should be cloned | ||
| 4 | |||
| 5 | 10 | ▶ | use v5.26; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 10 | ▶ | use Moo::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 10 | ▶ | use MooX::TaggedAttributes -propagate, -tags => 'cloneclear'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 10 | ▶ | use experimental 'signatures', 'postderef'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 10 | ▶ | use namespace::clean -except => [ '_tag_list', '_tags' ]; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | |||
| 14 | 10 | our $VERSION = '0.21'; | |
| 15 | |||
| 16 | |||
| 17 | |||
| 18 | |||
| 19 | |||
| 20 | |||
| 21 | |||
| 22 | |||
| 23 | |||
| 24 | 0 | ▶ | sub clone ( $self ) { |
|
Subroutine
clone: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 25 | 0 | require Clone; | |
| 26 | 0 | Clone::clone( $self ); | |
| 27 | } | ||
| 28 | |||
| 29 | |||
| 30 | |||
| 31 | |||
| 32 | |||
| 33 | |||
| 34 | |||
| 35 | |||
| 36 | |||
| 37 | |||
| 38 | |||
| 39 | |||
| 40 | |||
| 41 | |||
| 42 | 0 | ▶ | sub clone_simple ( $self ) { |
|
Subroutine
clone_simple: not called CC=2 SCAR=17.9
Pod
documented
| |||
| 43 | 0 | my $clone = $self->clone; | |
| 44 | 0 | $clone->$_ for map { "clear_$_" } keys $self->_tags->{cloneclear}->%*; | |
| 45 | 0 | return $clone; | |
| 46 | } | ||
| 47 | |||
| 48 | 10 | 1; | |
| 49 | |||
| 50 | # | ||
| 51 | # This file is part of CXC-DB-DDL | ||
| 52 | # | ||
| 53 | # This software is Copyright (c) 2022 by Smithsonian Astrophysical Observatory. | ||
| 54 | # | ||
| 55 | # This is free software, licensed under: | ||
| 56 | # | ||
| 57 | # The GNU General Public License, Version 3, June 2007 | ||
| 58 | # | ||
| 59 | |||
| 60 | __END__ | ||