Mercurial > pub > Impl
view Lib/IMPL/Object/PublicSerializable.pm @ 188:029c9610528c
Memory leak tests in IMPL::Web::View
author | cin |
---|---|
date | Tue, 03 Apr 2012 20:08:42 +0400 |
parents | d1676be8afcc |
children | 4d0e1962161c |
line wrap: on
line source
package IMPL::Object::PublicSerializable; use strict; use IMPL::Class::Member; sub restore { my ($class,$data,$refSurrogate) = @_; if ($refSurrogate) { $refSurrogate->callCTOR(@$data); return $refSurrogate; } else { return $class->new(@$data); } } sub save { my ($this,$ctx) = @_; my %seen; my $val; defined($val = $this->$_()) and $ctx->AddVar($_,$val) foreach map $_->Name,$this->get_meta( 'IMPL::Class::PropertyInfo', sub { $_->Access == IMPL::Class::Member::MOD_PUBLIC and $_->canGet and not $_->ownerSet and not $seen{$_->Name} ++ }, 1 ); } 1;