| 1 | package Catmandu::Store::Hash; | ||||||||||
| 2 | |||||||||||
| 3 | 16 | ▶ | use Catmandu::Sane; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 16 | our $VERSION = '1.2025'; | |||||||||
| 6 | |||||||||||
| 7 | 16 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 16 | ▶ | use Catmandu::Util qw(:is); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 16 | ▶ | use Catmandu::Store::Hash::Bag; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 16 | ▶ | use namespace::clean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 16 | with 'Catmandu::Store'; | |||||||||
| 13 | 16 | with 'Catmandu::Droppable'; | |||||||||
| 14 | 16 | with 'Catmandu::Transactional'; | |||||||||
| 15 | |||||||||||
| 16 | has _hashes => | ||||||||||
| 17 | 23 | ▶ | (is => 'ro', lazy => 1, init_arg => undef, default => sub {+{}}); | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 18 | 16 | has init_data => (is => 'ro'); | |||||||||
| 19 | |||||||||||
| 20 | 30 | ▶ | sub BUILD { | ||||||||
|
Subroutine
BUILD: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||
| 21 | 30 | my ($self) = @_; | |||||||||
| 22 | 30 | ▶ | if (my $data = $self->init_data) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | 6 | $self->bag->add($_) for @$data; | |||||||||
| 24 | } | ||||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | 0 | ▶ | sub drop { | ||||||||
|
Subroutine
drop: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 28 | 0 | my ($self) = @_; | |||||||||
| 29 | 0 | $_->drop for values %{$self->bags}; | |||||||||
| 30 | 0 | return; | |||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | 2 | ▶ | sub transaction { | ||||||||
|
Subroutine
transaction: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||
| 34 | 2 | my ($self, $coderef) = @_; | |||||||||
| 35 | 2 | ▶ | &{$coderef} if is_code_ref($coderef); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 36 | } | ||||||||||
| 37 | |||||||||||
| 38 | 16 | 1; | |||||||||
| 39 | |||||||||||
| 40 | __END__ | ||||||||||