| 1 | package KiokuDB::TypeMap::Entry::Std::Expand; | ||
| 2 | 23 | ▶ | use Moose::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | |||
| 4 | 23 | ▶ | no warnings 'recursion'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 23 | ▶ | use namespace::clean -except => 'meta'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 23 | requires qw( | |
| 9 | compile_create | ||
| 10 | compile_clear | ||
| 11 | compile_expand_data | ||
| 12 | ); | ||
| 13 | |||
| 14 | sub compile_expand { | ||
| 15 | 307 | ▶ | my ( $self, $class, @args ) = @_; |
|
Subroutine
compile_expand: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 16 | |||
| 17 | 307 | my $create = $self->compile_create($class, @args); | |
| 18 | 307 | my $expand_data = $self->compile_expand_data($class, @args); | |
| 19 | |||
| 20 | return sub { | ||
| 21 | 4075 | ▶ | my ( $linker, $entry, @args ) = @_; |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 22 | |||
| 23 | 4075 | my ( $instance, @register_args ) = $linker->$create($entry, @args); | |
| 24 | |||
| 25 | # this is registered *before* any other value expansion, to allow circular refs | ||
| 26 | 4075 | $linker->register_object( $entry => $instance, @register_args ); | |
| 27 | |||
| 28 | 4075 | $linker->$expand_data($instance, $entry, @args); | |
| 29 | |||
| 30 | 4075 | return $instance; | |
| 31 | 307 | }; | |
| 32 | } | ||
| 33 | |||
| 34 | sub compile_refresh { | ||
| 35 | 307 | ▶ | my ( $self, $class, @args ) = @_; |
|
Subroutine
compile_refresh: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 36 | |||
| 37 | 307 | my $clear = $self->compile_clear($class, @args); | |
| 38 | 307 | my $expand_data = $self->compile_expand_data($class, @args); | |
| 39 | |||
| 40 | return sub { | ||
| 41 | 27 | ▶ | my ( $linker, $instance, $entry, @args ) = @_; |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 42 | |||
| 43 | 27 | $linker->$clear($instance, $entry, @args); | |
| 44 | |||
| 45 | 27 | $linker->$expand_data($instance, $entry, @args); | |
| 46 | 307 | }; | |
| 47 | } | ||
| 48 | |||
| 49 | 23 | __PACKAGE__ | |
| 50 | |||
| 51 | __END__ | ||