| 1 | package MoobX::Hash; | ||||||||||
| 2 | 4 | our $AUTHORITY = 'cpan:YANICK'; | |||||||||
| 3 | # ABSTRACT: MoobX wrapper for hash variables | ||||||||||
| 4 | 4 | $MoobX::Hash::VERSION = '0.1.2'; | |||||||||
| 5 | |||||||||||
| 6 | 4 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 4 | ▶ | use experimental 'postderef'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | has value => ( | ||||||||||
| 11 | traits => [ 'Hash' ], | ||||||||||
| 12 | is => 'rw', | ||||||||||
| 13 | 0 | ▶ | default => sub { +{} }, | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 14 | 4 | handles => { | |||||||||
| 15 | FETCH => 'get', | ||||||||||
| 16 | STORE => 'set', | ||||||||||
| 17 | CLEAR => 'clear', | ||||||||||
| 18 | DELETE => 'delete', | ||||||||||
| 19 | EXISTS => 'exists', | ||||||||||
| 20 | }, | ||||||||||
| 21 | ); | ||||||||||
| 22 | |||||||||||
| 23 | 0 | ▶ | sub BUILD_ARGS { | ||||||||
|
Subroutine
BUILD_ARGS: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 24 | 0 | my( $class, @args ) = @_; | |||||||||
| 25 | |||||||||||
| 26 | 0 | ▶ | unshift @args, 'value' if @args == 1; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 27 | |||||||||||
| 28 | 0 | return { @args } | |||||||||
| 29 | } | ||||||||||
| 30 | |||||||||||
| 31 | 5 | ▶ | sub TIEHASH { | ||||||||
|
Subroutine
TIEHASH: called CC=1 SCAR=0.0
| |||||||||||
| 32 | 5 | (shift)->new( value => +{ @_ } ) | |||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | 11 | ▶ | sub FIRSTKEY { my $self = shift; my $a = scalar keys $self->value->%*; each $self->value->%* } | ||||||||
|
Subroutine
FIRSTKEY: called CC=1 SCAR=0.0
| |||||||||||
| 36 | 11 | ▶ | sub NEXTKEY { my $self = shift; each $self->value->%* } | ||||||||
|
Subroutine
NEXTKEY: called CC=1 SCAR=0.0
| |||||||||||
| 37 | |||||||||||
| 38 | |||||||||||
| 39 | |||||||||||
| 40 | 4 | 1; | |||||||||
| 41 | |||||||||||
| 42 | __END__ | ||||||||||