| 1 | package Iterator::Flex::Role::Reset::Method; | ||
| 2 | |||
| 3 | # ABSTRACT: Implement reset as a method | ||
| 4 | |||
| 5 | 1 | ▶ | use v5.28; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 1 | our $VERSION = '0.33'; | |
| 10 | |||
| 11 | 1 | ▶ | use Role::Tiny; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | |||
| 13 | 1 | ▶ | use namespace::clean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | |||
| 15 | |||
| 16 | |||
| 17 | |||
| 18 | |||
| 19 | |||
| 20 | |||
| 21 | |||
| 22 | |||
| 23 | |||
| 24 | |||
| 25 | around reset => sub { | ||
| 26 | 0 | ▶ | my $orig = shift; |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 27 | 0 | my $self = shift; | |
| 28 | 0 | $self->_apply_method_to_depends( 'reset' ); | |
| 29 | |||
| 30 | 0 | $self->$orig; | |
| 31 | 0 | $self->_clear_state; | |
| 32 | |||
| 33 | 0 | return; | |
| 34 | 1 | }; | |
| 35 | |||
| 36 | 1 | *__reset__ = \&reset; | |
| 37 | |||
| 38 | |||
| 39 | 1 | requires 'reset'; | |
| 40 | 1 | requires '_clear_state'; | |
| 41 | 1 | 1; | |
| 42 | |||
| 43 | # | ||
| 44 | # This file is part of Iterator-Flex | ||
| 45 | # | ||
| 46 | # This software is Copyright (c) 2018 by Smithsonian Astrophysical Observatory. | ||
| 47 | # | ||
| 48 | # This is free software, licensed under: | ||
| 49 | # | ||
| 50 | # The GNU General Public License, Version 3, June 2007 | ||
| 51 | # | ||
| 52 | |||
| 53 | __END__ | ||