diff options
Diffstat (limited to 'lib/Data/MultiValued/Tags.pm')
-rw-r--r-- | lib/Data/MultiValued/Tags.pm | 44 |
1 files changed, 31 insertions, 13 deletions
diff --git a/lib/Data/MultiValued/Tags.pm b/lib/Data/MultiValued/Tags.pm index 083bbb8..9c52510 100644 --- a/lib/Data/MultiValued/Tags.pm +++ b/lib/Data/MultiValued/Tags.pm @@ -35,19 +35,6 @@ sub _build__storage { Data::MultiValued::TagContainer->new(); } -sub _rebless_storage { - my ($self) = @_; - - bless $self->{_storage},'Data::MultiValued::TagContainer'; -} - -sub _as_hash { - my ($self) = @_; - - my %ret = %{$self->_storage}; - return {_storage=>\%ret}; -} - =head2 C<set> $obj->set({ tag => $the_tag, value => $the_value }); @@ -121,6 +108,37 @@ sub clear { $self->_storage->clear(\%args); } +=head1 Serialisation helpers + +These are used through +L<Data::MultiValued::UglySerializationHelperRole>. + +=head2 C<_rebless_storage> + +Blesses the storage into L<Data::MultiValued::TagContainer>. + +=cut + +sub _rebless_storage { + my ($self) = @_; + + bless $self->{_storage},'Data::MultiValued::TagContainer'; +} + +=head2 C<_as_hash> + +Returns the internal representation with no blessed hashes, with as +few copies as possible. + +=cut + +sub _as_hash { + my ($self) = @_; + + my %ret = %{$self->_storage}; + return {_storage=>\%ret}; +} + =head1 SEE ALSO L<Data::MultiValued::TagContainer>, L<Data::MultiValued::Exceptions> |