diff options
Diffstat (limited to 'Data-MultiValued/lib/Data/MultiValued/UglySerializationHelperRole.pm')
-rw-r--r-- | Data-MultiValued/lib/Data/MultiValued/UglySerializationHelperRole.pm | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/Data-MultiValued/lib/Data/MultiValued/UglySerializationHelperRole.pm b/Data-MultiValued/lib/Data/MultiValued/UglySerializationHelperRole.pm deleted file mode 100644 index e586dec..0000000 --- a/Data-MultiValued/lib/Data/MultiValued/UglySerializationHelperRole.pm +++ /dev/null @@ -1,35 +0,0 @@ -package Data::MultiValued::UglySerializationHelperRole; -use Moose::Role; - -sub new_in_place { - my ($class,$hash) = @_; - - my $self = bless $hash,$class; - - for my $attr ($class->meta->get_all_attributes) { - if ($attr->does('Data::MultiValued::AttributeTrait')) { - $attr->_rebless_slot($self); - } - } - return $self; -} - -sub as_hash { - my ($self) = @_; - - my %ret = %$self; - for my $attr ($self->meta->get_all_attributes) { - if ($attr->does('Data::MultiValued::AttributeTrait')) { - my $st = $attr->_as_hash($self); - if ($st) { - $ret{$attr->full_storage_slot} = $st; - } - else { - delete $ret{$attr->full_storage_slot}; - } - } - } - return \%ret; -} - -1; |